Read Chapter 1 before starting this assignment.
To see how it works, launch BeetleGUI.jar located on \\home\classes in the folder
Note, your version will be text based rather than window based.
Chapter 1 of your text describes the Beetle Game and gives the Java code for running it on the command line. Type in the code exactly as it is given in the text. (Note, part of the Beetle class can be downloaded below).
While it may seem tedious to type in the code from the textbook, it is a useful exercise because it gives you the opportunity to get up-to-speed with Netscape 5.5.1 and also to refresh your Java programming skills. Pay particular attention to such things as how classes are constructed, syntax in general, and standard methods that most classes should contain, such as accessors, getters, setters(mutators), and toString.You may download part of Beetle.java here to save a little time. You will have to read through it carefully to see what is missing.
Implement Die.java, Beetle.java, and BeetleGame.java (in that order) exactly as in the text. Be sure to test each class individually before implementing the next class. You should run it on the command line to make sure it works.
To see how it works, launch MindReader.jar located on \\home\classes in the folder
\gorr\cs241Fa07\JarFiles
Rules:
Implementation:
Implement this game using a gui interface (e.g. see the jar file). Make sure you include a title label containing the name of the game as well as your name.
Before you begin, think about the structure. It is important to separate the GUI interface from the game itself, so it is recommended that you have separate classes MindReaderFrame.java and MindReaderGame.java.
In order to experiment with different predictive strategies used by the computer, you might want to create another class called Predictor.java. This should have a method, e.g. called predict(), which returns a prediction (heads or tails). Initially, you can just randomly generate this, but once the program is working, you should try to implement several different strategies based on past behavior of the human player.
When you are done the programming, you must also do the following:
Generate Javadoc: Place the javadoc comments in the code so that you can generate the javadoc. You may do this either by hand or using the Netbeans tool. To use the tool, right-click the java file in the Projects window, choose Tools; Auto Comment .... Enter the descriptions and tags. Once all of the javadoc text is entered, you can generate the javadoc by Right-Clicking on the project name, and choosing "Generate Javadoc for Project".
Generate the Jar file: You should be able to run your program outside of Netbeans by double clicking on the jar file. The jar file can be found in the dist folder of the project. To generate the jar file, make sure you do a "Clean and Build" in Netbeans. Then try closing Netbeans and running the jar file. Before turning it in, rename your jar file to be MindReader_YourName.jar.
After I receive your jar file I will place it (along with everyone else's) in \\home\classes in the folder
Try playing what other people have implemented and rate the quality of their program. Is the interface good? Can you figure out their strategy?
Normally, the assignment will be due at class time. However, since we miss Monday due to Labor Day, I will set the due date to Thursday Sept 6. That way, you will be able to ask some last minute questions in class on Wed.
By Thursday, you should have done the following:
Remember, the lab is worth 10 points max. Late assignments will be penalized: