CIT 597 Assignment 2: TurnBlue
Fall 2009, David Matuszek

"TurnBlue" is a puzzle game, based on a much older computer game whose name I have forgotten. I have chosen this game because the programming logic is simple, and should not itself be any challenge; thus, almost all of the difficulties you encounter (and they may be considerable) will be in learning to use a new programming language.

Purposes of this assignment:

General idea of the assignment:

"TurnBlue" is a puzzle game, based on a much older computer game whose name I have forgotten.

The player is presented with an 8x8 grid of squares, some of which are red, and the others blue. By clicking on various squares, the player tries to make all the squares blue. The player starts on level 1; when the player succeeds, the game proceeds to the next level.

At the first (dead simple) level, the board is almost entirely blue, and the player has to click just one (correct) square in order to win; at the second level, two squares; and so on, up to a maximum of 32 squares. So that there is a definite end to the game, if the player clicks five times more than is required by a level, the game is over.

The logic is simple. When the user clicks a square, up to five squares change color (red to blue, or blue to red): the square clicked on, the squares directly above and below the clicked square, and the squares directly to the left and right of the clicked square. If the clicked square is on a border or in a corner, fewer than five squares will change color.

How to create the puzzle

To create a puzzle at level N, begin with a board that is entirely red blue (solved). Then simulate N clicks on the board in randomly chosen squares, taking care not to choose the same square twice (clicking a square a second time "undoes" the first click and makes the game easier--we don't want that.) This is all just computation--don't show this happening to the player. The player should see only the puzzle that has been constructed in this way.

Programming requirements


Use XHTML 1.1 with CSS.

Due date:

Midnight Sunday, October 4. Send a URL to our TA, Chandni (but not to me this time).