Skip to content

Instantly share code, notes, and snippets.

@wray
Last active October 1, 2016 16:00
Show Gist options
  • Save wray/48cef3a6766ece0d8370 to your computer and use it in GitHub Desktop.
Save wray/48cef3a6766ece0d8370 to your computer and use it in GitHub Desktop.
# Choose your own adventure game
# MARS
def bad_alien():
print("The object fires a laser at you!")
def friendly_alien():
print("A little alien comes from the object with some spare O2 for you.")
print("You land on mars and your oxygen generator has failed, so you only have a few hours on the planet. However, you see something in the distance! What do you do?")
choice = raw_input("A) Leave Now, B) Go to object, or C) Scan Object ")
if choice == "A":
# First branch of story
print("You begin to leave and notice the object moves. What do you do?")
choice = raw_input("A) Continue leaving or B) Stay on the planet to investigate ")
if choice == "A":
bad_alien()
else:
friendly_alien()
# Your adventure can continue here.
elif choice == "B":
# Second branch of story
print("As you approach the object, it is clearly an alien. What do you do? ")
choice = raw_input("A) Investigate the object or B) Leave ")
if choice == "A":
friendly_alien()
else:
bad_alien()
else:
# Third branch of story
print("After scanning the object for 30 minutes, you get no usable information. What do you do now?")
choice = raw_input("A) Scan More or B) Leave the planet ")
if choice == "A":
bad_alien()
else:
bad_alien()
Copy link

ghost commented Oct 1, 2016

I didn't know you wrote this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment