Problem 5.3

CIS 210 Home Page Last updated 2007/10/11 21:47:08

Problem 5.3: A Crossword Puzzle Board

For this problem you will build a CrosswordBoard class with a board represented as a two-dimensional array of characters, and with methods for adding words written horizontally (left to right) and vertically (top to bottom) starting from any board position. You will also learn to use the StringBuffer class.

CrosswordBoard

Complete the implementation of the class CrosswordBoard that is started in CrosswordBoard.java. You must fill in the missing code of the constructor and the missing methods placeWordAcross and placeWordDown.

Placing words

The rules for placing a word on the board are:

A Test Program

To test your implementation, use the test driver program TestBoard.java. Feel free to add your own tests to make sure your code works correctly.

Turn in

Turn in CrosswordBoard.java.