DPA 4010 / 6010
Spring 2016
Hyperspace Maze
Homework
Assignment
5
Due: Midnight,
Wednesday, March 23
Assignment: Now that you can load a maze
and move a character around in it, it is time to add a
hyperspace feature to the game. To do this, you should add a
stack to your project that can be used to store the row and
column numbers of each room in which you made a decision of
which way to go. Any room that has more than two doors (one that
lead you in, and one leading out) will be a decision point. By
pushing the row and column numbers of these rooms onto a stack
whenever you enter such a room, you will have the memory needed
to go back to that room in a hyperspace jump. Use the RETURN key
as the hyperspace key. It has ASCII code 13, or can be
referenced by its C escape sequence '\r'. When RETURN is
pressed, your character should jump back to the room at the top
of the stack.
Advanced
Extension: Mark each door with a
Boolean variable that records whether or not the door was passed
through already. That way, when you revisit a room you will know
which doors you have not yet tried. Each door that has been
tried should be indicated on the map with some sort of mark.
Please submit
your program using the standard handin procedure. You should include your
all of your source code .cpp and .h
files, and a Makefile.