An adventure game is a natural for having you test your skills
at class definition. An adventure game (for those of you who have
never been Zork-ed or wandered in twisty tunnels that look all
the same) lets you give commands (real simple -- one or two words)
to wander through a virtual world. Descriptions of the world are
all in text.
Here are the constraints:
Your system must be able to run with the following input from the
keyboard (without
visiting any room twice):
north
east
take key
up
south
use key
quit
After each of these commands, some description of the room (including
exits) and current
state must be provided. Your game must also support the
Look verb to view the description of the room (including
exits) and
current state. Look by itself should provide the
description of the room. Every object should also respond to
look, e.g., look key. You must also
provide some simple error handling, e.g., for unknown commands,
actions on non-existent objects, going to unavailable exits, etc. In
short, no matter what a user types, your system must respond
reasonably (e.g., "unknown command" or "no exit in that direction") and must not crash.
The metaphor of the game, additional rooms, additional hierarchies,
etc. are all up to you.
If at all possible, please provide your TA with only one .cc
file which can be compiled with g++ on acme. If you need to
use .h files, then provide all the files to your TA.
In your writeup, please include a run of your system with the
above input. You must, as always, include an OOA, OOD, and code
listing. Also include a Reuse section. Also, please mail your
code to your TA.
Assignments are due December 11 (during Dead Week) in class.
Discuss this assignment in CaMILE.