Freecell: Instructor Guide

At the College of William and Mary, this assignment is used in our CS 2.5 course (our third course in programming) entitled Software Development. It was presented as part of the Nifty Assignments Panel aat SIGCSE 2007. It is also discussed by Noonan and Hott in a paper at SIGCSE 2007. It could also be used as a GUI assignment in CS 2. As a stand-alone assignment, I would allow about 2-3 weeks.

Implementing one of these Solitaire games can be done in about 300 NCSS. Students can easily use 2-3 times that number if they are not careful. Making group or super moves optional simplifies the game significantly.

Assignment Niche

Freecell (or other Solitaire game) could be used as a CS2 assignment or in a later course. It is larger than the typical CS2 assignment. It is more about object-oriented design and analysis and about design patterns, than it is about algorithms (which is more typcial in CS2). It also requires a knowledge of GUI programming, including event-handling.

Freecell is a fun and appealing visual game. It is non threatening. The students seem o genuinely enjo working on it. At our school, this is the first non-throw-away program they ever write.

The project can be done in about 300 NCSS; so it can be done in 2-3 weeks depending on the students background.

Our Use of the Assignment

At our school the students build 3 different solitaire games over the lenght of a semester. Three assignments are used to build the first game, namely: a test driven development test of basic moves, the model (game) only with no input or output, and finally, the GUI version of the game.

In the 4th and 5th projects the students build two more solitaire games. In the final project, features, such as a toolbar, an undo, a redo, a timer, etc., are added to all three games.

The entire project can be done in about 600 NCSS. The students are amazed at how quickly they can build the 2nd and 3rd games after taking half a semester to build the first game.

Extra Credit

Robert Noonan
Mar 6, 2007