Created
January 29, 2021 22:16
-
-
Save MichaelSheinman/102929a48029dd6e4a42c05c7c35b948 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup | |
yes_no = ["yes", "no"] | |
directions = ["left", "right", "forward", "backward"] | |
# Introduction | |
name = input("What is your name, adventurer?\n") | |
print("Greetings, " + name + ". Let us go on a quest!") | |
print("You find yourself on the edge of a dark forest.") | |
print("Can you find your way through?\n") | |
# Start of game | |
response = "" # string variable | |
while response != "yes" and response != "no": | |
response = input("Would you like to step into the forest?\nyes/no\n") | |
if response == "yes": | |
print("You head into the forest. You hear crows cawwing in the distance.\n") | |
elif response == "no": | |
print("You are not ready for this quest. Goodbye, " + name + ".") | |
quit() | |
else: | |
print("I didn't understand that.\n") | |
# Next part of game | |
response = "" | |
while response not in directions: | |
print("To your left, you see a bear.") | |
print("To your right, there is more forest.") | |
print("There is a rock wall directly in front of you.") | |
print("Behind you is the forest exit.\n") | |
response = input("What direction do you move?\nleft/right/forward/backward\n") | |
if response == "left": | |
print("The bear eats you. Farewell, " + name + ".") | |
quit() | |
elif response == "right": | |
print("You head deeper into the forest.\n") | |
elif response == "forward": | |
print("You cannot scale the wall.\n") | |
response = "" | |
elif response == "backward": | |
print("You leave the forest. Goodbye, " + name + ".") | |
quit() | |
else: | |
print("I didn't understand that.\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment