01.12.09 - 05.08.09
Introduction to Java Programming
Monday Wednesday
04:00 PM - 05:20 PM
Comments placed in each source code file. | 5 pts |
Files put into JAR format and is made executable. | 5 pts |
Application source and class files included. | 5 pts |
Program compiles and executes without errors | 5 pts |
Program allows required user inputs | 10 pts |
Program performed input error checking | 20 pts |
Game play executed correctly | 20 pts |
Program uses optimal strategy in play | 10 pts |
GUI functions properly (appearance and user input) | 10 pts |
Player class created and used | 10 pts |
Total | 100 pts |
For this lab you will need to recreate the game of NIM from lab2 using classes and a graphical user interface. A player class should be created that will encapsulate the properties and behaviors of a player in the game. The Player class should be able to be used for both computer and human players and should include the pile (number of stones remaining) as a data member as well as methods for executing a human player's move and the computer player's move (call them move( int s ) and automove( )).
The interface for the game should consist of:
Example:
Your version of this program, because it is an application, not an applet like the example given above, does not require a 'Start Game' button. I included this in the applet version because without it, you would have been required to play a game every time you visited this page.