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.

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 Tuesday then the completed program due next Friday.

Phase I Due Tuesday, November 15 by 3:00pm - emailed tar file Note: 3:00pm is so that you don't interfere with the other section's lab

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 (type = "I"). Then, add code for the computer making a choice using some intelligent algorithm. This should not alter computer (type = "C") player. Hint - for intelligent strategies, search for "NIM" on the web.