Due: Tuesday 4/22 10:00am
Submission name: w16_wordGrid
Word Searching!
Over the next few days we will be creating a word search program, the core of this will be the class WordGrid
, which will contain a 2D array of char
values, as well as other necessary fields. To start, write the WordGrid
class as follows:
- Fields
char[][] grid
int size
- More to be added later
- Methods
WordGrid(int s)
- Set
size
tos
. - Initialize
grid
to be asize
xsize
array. - Call
fillGrid()
- Set
void fillGrid()
- Fill
grid
with random upper case letters.
- Fill
void drawGrid
- Display the contents of
grid
on the screen, taking up the full size.
- Display the contents of
Write a driver file that:
- Sets global constants for the size of each displayed character and the size of the word grid.
- Sets the screen size to exactly fit the word grid.
- Creates a new word grid using the size global variable.
- Tests
drawGrid
.