CS 329: Project #4

Due Friday, October 9, 2015


There will be done in two groups of five each. It is a full-group effort, which means that the five of you will work on a single implementation. Other than your responses to the concurrency-related questions (below), you will turn in a single deliverable for all of you. That is going to impose some interesting challenges in project management, and you will probably struggle with trying to keep a single, consistent code base. Get to know and use SVN (or Git, if you must).

A Puzzle

The Fifteen-puzzle, a classic toy of the late 19th-century, consists of a 4x4 frame, holding fifteen numbered tiles (1 - 15). A tile can only be moved by sliding it into the blank space. The object is to move the tiles such that they are arranged in the following order:

Construct a program that presents the user with a scrambled 15-puzzle, and lets them play at solving it. You should add the following features:

In addition, for each of the non-trivial, public methods include a specification and enforcement of each method's contract through the use of assert statements. I will leave it to your judgement to determine which methods are "trivial" or not, but if the method is public and not trivial, it must have a contract.

Finally, it should be clear that many of this program's components must run in parallel, and that means you'll have to think about controlling access to shared resources. Which methods (or blocks) will need to be synchronized? Are there instructions running in different threads for which you must guarantee a happens-before relationship? How will you enforce that?

Turn In:

hr>
John H. E. Lasseter