CPSC 120 Project #3: Design Specifications

For your Nim project you must write classes to model a Nim board and a Nim player that meet the following specifications.

NimBoard Class

Instance Data: Three integers representing the number of sticks in each row of the board.

Methods:

Player Class

Instance Data:

Methods:

Nim Game

The Nim game will be played in the main method of a Nim class. Here you will need to use the NimBoard and Player classes to play the game as described on the handout. (Note: You could have an additional class that represents the game. It would have a method to play once (among other methods). Your main method would have the loop to play multiple times and keep track of the statistics.)

Working Time Line

You should do the work in small chunks testing each a you go. The portions due will be in two parts - some basic work due Saturday then the completed program due next Friday.

Phase I (Due Saturday, November 12 by 5:00 - emailed tar file)

For Phase I have the following completed:

Phase II (Completed Project) After getting the basics correct, you need to add the code to the Player class for the player taking a turn and you need to write the program to play the game. A suggested order of doing this:

Extra Credit: Add an "intelligent" strategy for the computer. To do this add a third type of the player - something to represent an intelligent computer. Then, add code for the computer making a choice using some intelligent algorithm. Leave the random computer as is.