CIS 250 Dungeon
The objective of this assignment is to finish creating some classes that
use a linked list to get a basic dungeon explorer up and running. You will
also have to deal with multiple source files.
Assignment
You have to finish the implementation of four classes for this program:
Path, Item, Room, and Dungeon. When you get done, you should be able to
walk around in the dungeon, and possibly escape to the outside if you
make the correct decisions in the dungeon. A number of files are given
to you to start you off. Make sure you add documentation to the
documentation comments at the beginning of the files you have to modify:
Dungeon.h and Dungeon.cpp.
- tlist.h: a templated linked list class
- dungeon.txt: a data file for the program to use;
this file defines the dungeon
- PlayDungeon.cpp: This is the main file. It knows how to read
the data file, construct the dungeon, display debugging information, ask the user
for commands, and make the commands work.
- Dungeon.h: This file defines the Path, Item, Room, and
Dungeon class headers. This is one of the two files you have to finish. Comments
in the file specify what you will have to do. Ask if you are unsure.
- Dungeon.cpp: This is the implementation file
for the Path, Item, Room, and Dungeon classes. This is one of the two files you have to
finish. Comments in the file specify what you will have to do. Ask if you are unsure.
- These files are already on kermit (in ~dklick/examples/cis250/dungeon). You can get them into
your home directory by copying them. I would suggest you make a new directory
just for this project.
- First, make sure you are in your home directory: cd
- If you want to place the files in a new directory named dungeon, do the following:
- make a new directory: mkdir dungeon
- make the new directory your current directory: cd dungeon
- Now you can copy the files by typing: cp ~dklick/examples/cis250/dungeon/* .
When you are ready to compile and test:
- make sure all the files are in the same directory
- if you are on kermit, you can type:
g++ -o dungeon Dungeon.cpp PlayDungeon.cpp
- if you are on kermit, you can run it (without debugging info):
./dungeon dungeon.txt
- if you are on kermit, you can run it (with debugging info):
./dungeon -d dungeon.txt
Sample output
You are in the Main Hall
A long, dusty, dark, dank hallway running north-south.
Exits are: n, s
Enter command: n
Oops! You just walked into a bottomless pit and will eventually die.
You should have gone the other way to avoid the waiting.
Thanks for playing. Visit again soon.