Lab 1: Mind Reader
CS 241: Data Structures, Fall 2007


Due Date: Sept 6

Goals

Reading

Read Chapter 1 before starting this assignment.

Part 1: The Beetle Game

To see how it works, launch BeetleGUI.jar located on \\home\classes in the folder

\gorr\cs241Fa07\JarFiles

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).

Part 2: The Mind Reader

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:

  1. 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".

  2. Generate UML Diagram: The UML class diagram of the Beetle Game is given at the end of the chapter. The appendix also gives an overview of UML. Draw the UML class diagram for the Mind Reader Program.
  3. 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

    \gorr\cs241Fa07\StudentWork\MindReader

    Try playing what other people have implemented and rate the quality of their program. Is the interface good? Can you figure out their strategy?

Evaluation Check List

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:

  1. Implemented the Beetle Game Program as given in the text.
  2. Implemented the Mind Reader Program using your best strategy.
  3. Written and generated the javadoc for the Mind Reader program.
  4. Generated the jar file for the Mind Reader program and renamed it.
  5. Zipped together 1) the entire netbeans Beetle Game project and 2) the entire netbeans MindReader Project and emailed to gorr. On the subject line, include the course number and the lab number, e.g. CS241 Lab 1. Note, this subject line will be used to filter the email so, if you don't write it exactly as shown, your assignment will most likely be lost somewhere in the instructor's inbox.
  6. Demonstrated the programs to the instructor.
  7. In class on Monday Sept 10, we will go over your UML Diagram so please make sure that you have it with you.

Remember, the lab is worth 10 points max. Late assignments will be penalized:


[top]  [Schedule]  [Home]