CSPP 51090 & CMSC 22001: Software Construction Assignment 4

Due: April 27, 2004

Your task is to implement Scrabble-o-matic, which implements a fully automated version of Scrabble. [9pts]

The program provides an administrator and a player. The administrator manages the board, the remaining tiles, and the game itself. Each player registers with the administrator. Once the game is started, the administrator gives each of the players one turn per round.

The player plays according to this simple strategy:

  • If it is the first turn, and the player has the letter "a" or "i", play it on the initial square.
  • Otherwise, the player exchanges tiles.

To give you a starting point for your design, we provide a collection of Java-style interfaces:

Whether you use Java or not, you must structure your program as these interfaces suggest. In Java, you must use these interfaces.

The administrator does not need to be able to detect all forms of cheating, but it must be able to tell if a play results in a legal board position. If a player makes a play resulting in an illegal board position, that player is dropped for the remainder of the game.

A board is a valid board if, for each square, one of the following conditions is met (in this order):

  1. There is no tile on this square.
  2. There is a tile above this square and one to the left (so the tile is in the middle of two words)
  3. There is a tile above of the square and no tile to the left or right of the square (so the tile is in the middle of a word vertically)
  4. There is a tile to the left of the square and no tile below or above the square (so the tile is in the middle of a word horizontally)
  5. There is no tile to left or to the above, but there are tiles both right and below. In this case, the sequence of tiles from this point to the right and down must form a word (this tile begins two words).
  6. This is no tile above, but there is one below. In this case, the sequence of tiles from this point down must form a word.
  7. This is no tile to the left, but there is one to the right. In this case, the sequence of tiles from this point to the right must form a word.
  8. There are no tiles above, below, left or right of this tile. In this case, the tile must itself be a word (with a single letter).
If there is some place on the board that does not meet at least one of those conditions, the board is invalid.

Of course, develop test suites for all of your code. But, be especially sure to develop test suites for the code that detects legal board positions and does the scoring.

As a stress test, run two instances of the player in the server 100 times. Record the number of times each instance wins. [1pt]



CSPP 51090 & CMSC 22001: Software Construction