Course Project: Game

Create a computer game. This can be entirely text based, or you can do some graphics with GridWorld, Canvas or other techniques if you like. No graphics are required or necessary, though, as all that matters is if you can use ideas in the AP subset to get the computer to do the algorithms that you want. Your game could be a single player game (like a puzzle of some sort), a two player game where both players take turns out the keyboard, or a one where the computer plays against you.

The choices for games are endless. A few suggestions to get you started are Bagels (see description at the bottom of this document for details), 3D Tic-Tac-Toe, Dots and Boxes, Battleship, and Go Fish, to name a few.

Make sure to indicate in program documentation which class contains your main method so that I know how to run it.

Thoughts on grading

I will grade the projects based on the following factors, in the following order:

  1. How cleanly does your program runs: is it relatively bug free? Does it crash?
  2. Does it use reasonable object-oriented program design, or is all of your code crammed into "main"?
  3. Style.

It is perfectly ok to pick an easy goal in order to achieve. If you're new to this, Bagels is a fine choice. For people who want to push a little further, Battleship tends to work well (you do need two-dimensional arrays, but these are easy to do). For people with more advanced experience, the sky is the limit. Indulge yourself. But submit something new. Don't submit to me code which you have written in the past.

Rules for Bagels

Bagels is a two person paper-and-pencil game that is similar to but simpler than Mastermind. One person thinks of a 3-digit number, and the other person tries to guess it. The 3-digit number may have no repeated digits, but it may begin with a zero (so 012, 987, and 361 are legal, but 112 and 303 are not).

The Guesser (i.e., the human) makes a 3-digit guess. The Responder (i.e., the computer) compares the guess to the actual mystery number, and responds to the guess by some combination of the words "Pico," "Fermi," and "Bagels." The Guesser keeps guessing until the guess is the mystery number. Here are the response rules:

For example, suppose the mystery number is 395. Here are a few guesses and responses:
    246    B

    037    P

    105    F

    309    PF

    etc.
Note that if there are Picos and Fermis in the same response, all the Picos should be reported first. That is, you'd never say "PFP," thus suggesting that maybe the middle digit of the guess was the one in the correct position. Instead, you'd say "PPF," regardless of which digit was the Fermi, and which two were the Picos.

If you want more clarification of the rules of Bagels, let me know.

If you choose this project and want to push yourself further, you can add intelligence by writing a program that will play Bagels with you, both as the Guesser and the Responder. Having it act as Guesser is tricky, but fun (my students do this).