Text Adventure
The purpose of this lab is to create a piece of interactive fiction in the form of a text adventure game. If you are unfamiliar with the text adventure genre, Colassal Cave Adventure or AI Dungeon are examples.
Requirements
When run, your program should tell a story that includes various decision points that allow the reader experience alternate storylines. You won't be graded on the quality of your prose, but it might be more fun to explore a meaningful narrative.
On the technical end, your program must include the following:
input
to collect instructions from the user as neededprint
to display your narrative to the userexit
to end your program as neededif
,elif
, andelse
to branch into different parts of the story- Must include at least 4 separate
if
statements - Must use
else
andelif
at least once - Must include at least one use of nested
if
statements
- Must include at least 4 separate
Example
Here is an example start to a possible fantasy narrative:
print("You are alone in a dark cave. There is a sword next to you.")
print("1) Take the sword")
print("2) Leave the cave")
choice = input("Enter your choice: ")
if choice == "2":
print("You leave the cave. You are killed by a goblin outside.")
exit()
print("You take the sword and leave the cave.")
print("A goblin sees you and attacks, but you block with your sword.")