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.

  1. tlist.h: a templated linked list class
  2. dungeon.txt: a data file for the program to use; this file defines the dungeon
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. First, make sure you are in your home directory: cd
  8. If you want to place the files in a new directory named dungeon, do the following:
    1. make a new directory: mkdir dungeon
    2. make the new directory your current directory: cd dungeon
  9. Now you can copy the files by typing: cp ~dklick/examples/cis250/dungeon/* .

When you are ready to compile and test:

  1. make sure all the files are in the same directory
  2. if you are on kermit, you can type: g++ -o dungeon Dungeon.cpp PlayDungeon.cpp
  3. if you are on kermit, you can run it (without debugging info): ./dungeon dungeon.txt
  4. 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.