// This class implements a simple crossword board that permits // the placement of words across and down, checking to make sure // they fit and overlapping letters match. public class CrosswordBoard { char [][] theBoard; int rows; int cols; private static final char EmptySpaceChar = '*'; /** Set rows and columns, allocate space and initialize */ CrosswordBoard( int _rows, int _cols ) { // fill in the constructor } /* Each of the placeWord methods returns "true" and places word * in the board array if it fits. If there are any letters already * in the positions needed, they must match. If there is not enough * room, or letters conflict with letters already there, return false. */ // Add the placeWordAcross and placeWordDown methods /** Return a string representing the whole board, * with each row on a separate line (using \n to separate lines) * Use a StringBuffer object to build it. */ public String toString() { StringBuffer buf = new StringBuffer(rows*(cols+1)); // Do something here... return buf.toString(); } }