Twenty Questions/Animal Game

code directory

In my talk at the SIGCSE conference, and in the slides for that talk, I used the traditional "twenty questions" aka "guess an animal" game in which a binary tree is used to guide the user through a series of questions. I used this to demonstrate before and after, a method of showing how patterns can improve programs.

For the before program I used code from the book Data Structures and Other Objects, by Michael Main and Walter Savitch (Addison-Wesley). A diagram of the code used in the book is shown below.

no diagram

A class diagram for the after program is shown below, the code is accessible too both in a compressed tar far (winzip can handle this) and as individual files.

no diagram

Owen L. Astrachan
Last modified: Mon May 18 20:52:34 EDT 1998