Suggestions for Summer C.S. activities

Are you appalled at the thought of an entire Summer break with no programming? Or just bored by the lack of homework? Or even possibly wanting to get a headstart on the next semester? If so, I have some suggestions for you:

Some projects to consider

Examples and code for many of these can be found on the web. You will get the most out of the exercise if you plan your approach and debug your code before you look at someone else's solution. On the other hand, reading other people's code is often illuminating, and is a worthwhile skill to acquire.

Sieve of Eratosthenes:
great practice with arrays, loops, and integer arithmetic.
Shuffle:
To shuffle a deck of cards correctly is a bit subtle. Try your hand before peeking at the standard solution.
Number theory:
If you like number theory, you will love cryptography. To get serious with it, you'll need to use a "large integer" package. Random number generators fit here, too.
Buffton's needle:
compute pi with only straight lines, and NO trig functions!
Hangman:
grab a dictionary from the net.
Poker:
evaluating a poker hand is quite tricky. Define a class to represent a card, and a class that collects cards into hands.
Tic-tac-toe:
Fairly easy to code after you decide on a representation for the board.
Four-in-a-row:
Implementation is a lot like tic-tac-toe, but it does not have such an immediate complete winning strategy.
Battleship:
Can be done at many levels. See following game comments.
Series:
Keep track of wins and losses over multiple game.
Game graphics:
Take some text-mode game that works, and display it nicely: pictures for card games, hangman pictures, fancy tic-tac-toe layout, etc. There are lots of bitmapped pictures on the net that you can use, just be sensitive to copyrights.
Game sounds:
play an appropriate (or annoying!) noise after a hit or a miss, etc.
GUI interface:
Convert (or re-write) your game to provide a true GUI interface. This needs an event-driven program, and I don't recommend you do it in C or C++ because you will have to learn a lot of things peculiar to a specific operating system (whether MS-Windows, X-windows, or Macintosh).
Sockets:
allow opponent on a remote machine / different operating system.
Applet:
allow your game to run inside a browser (especially easy with Java).
Client-server:
allow multiple players. Don't try this with C/C++ if you have only one semester.
Symbolic computation:
create deriviative of an expression. Then simplify it. Hint: use Python, Haskell, Scheme or Prolog.
Strategy enhancements:
Write a good/optimal strategy for one of your games. This tends to be messy in an imperative language, so use Python, Haskell, Scheme or Prolog.
Machine learning:
Don't write the strategy yourself, let your program learn it. Decision trees, neural networks, and genetic algorithms can all be competitive.

Arc of Games

Notice in the list above that there is a progression, or arc, to the game projects. That is one of the appeals of game projects: You can always find more to do. Of equal import when deadlines are imminent, you can often also cut back on the requirements for games. For instance, in checkers, start out without implementing Kings. The game itself will be less interesting, but you can still demonstrate most of the same programming competence without Kings.

In the area of game strategy there is a similar arc. In particular, when implementing a computer player you should always start out with the "random-mover" strategy. It will usually be a lousy player, but it does exercise all the remaining parts of your system. (Ensuring that it generates only legal moves is a great test of your legal-move-tester.)

Furthermore, the random mover provides a benchmark for measuring how good your advanced strategies are. In particular, if a supposedly advanced strategy is beaten by the random-mover, you have serious questions to address.

Finally, the random-mover is often the strategy to bootstrap your machine learning method from.

Notice that the arcs have a natural bifurcation:

  1. increasingly attractive interfaces, and
  2. increasingly competent play.
Even if you take route (1) with sounds, client-server, etc., you are well advised to keep a text-mode interface if you ever want to work on route (2). Basically, to develop and test advanced strategies, you don't want to have to have an army of people clicking away. And it is really convenient to be able to have two computers play each other.


Return to my home page
CVS $Id: summer.html,v 1.3 2004/12/15 18:56:44 paulmcq Exp $