CS120
Programming Assignment #4
Due Friday Sept 22nd at the beginning of lecture.
For this assignment you will be creating a simple text based
adventure game. Each "room" in the adventure should be
represented by it's own function. (A "room" just represents a
particular area, not necessarily a literal room.)
Requirements:
- Each "room" should have some text describing the room and some options
for where the player can go next. You may also include some options for
what the player can do in that room. You should have at least six rooms.
- At least two of the "room" functions should
include a static variable that keeps track
of whether the room has been entered before. And something different
should happen
the first time the room is entered. For example, the first time
(and only the first time) that the
room is entered the player should get an object.
- There should be at least one (global) "score" variable, such as
amount of gold collected, number of butterflies rescued, number of clues
found, number of lives lost, amount of health remaining,
etc.. This variable should change as the player
moves between rooms. There should be a separate function
that prints the value of the variable for the player. That is, it should
print something like:
Oxygen Remaining: 120
for any room the character enters.
- Remember to put a comment at the beginning of the code with your name, section number, assignment number, etc.
Turn in: A copy of the program and sample output showing it runs.
In the sample ouput make sure you show what happens each time a room
is entered, both the first time and successive times.