
-----------------------------------
tupac
Sat Sep 22, 2007 1:53 pm

help with board/pegs
-----------------------------------
if anyone here is in UW CS133 please give me some pointers as to how to go by this program:
In this section, write a program that accepts an input number N (using the Scanner class), where N is between 1 and 5 inclusive. If the number is outside of that range, print an error message and exit. Otherwise, draw an instance of the Board class that has dimensions (2N + 1) by (2N + 1) and draw a series of squares on it using black pegs so it appears like the figure below.

*|*|*|*|*|*|*|
*|  | |  |  |  |*|
*|  |*|*|*|  |*|
*|  |*|  |*|  |*|
*|  |*|*|*|  |*|
*|  |  | |  |  |*|
*|*|*|*|*|*|*|

^Something like that should be the output.

so far i have:


import java.util.*;
import javax.swing.*;

public class squarePins
{
    public static void main(String

and the output looks something like this:

|*|*|*|*|*|
|  |  | |  |  |
|*|*|*|*|*|
|  |  | |  |  |
|*|*|*|*|*|

please help

thank you
- Dave
