Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- This is a framework for a python story that does nothing
- Author: Allen Thoe
- Date: 9/6/2019
- """
- def greeting():
- print("Hello, this is the story preface....")
- theName = input("What is your name? ")
- return theName
- #IN THIS EXAMPLE THERE IS NO RECURSION IF THEY TYPE IT WRONG
- def firstChoice():
- x = input("Hi " + name + ". Would you like to 'go' or 'stay'")
- if(x == 'go'):
- go()
- else:
- stay()
- #IN THIS EXAMPLE< RECURSION FORCES THE USER TO ANSWER A SPECIFIC WAY
- def go():
- print("You went")
- x = input("Ok " + name + ", Would you like to 'fight' or 'run': ")
- if(x == "fight"):
- fight()
- elif(x == "run"):
- run()
- else:
- print("I am sorry, I don't understand that.")
- print("Please only respond with 'fight' or 'run': ")
- go()
- def stay():
- print("You died...sorry")
- def run():
- print("You are a coward. Goodbye")
- def fight():
- print("You are brave but you die anyway. Goodbye")
- #THIS CREATES A PERSONALIZED VARIABLE TO BE USED THROUGHOUT THE STORY
- name = greeting()
- #INITIALIZE THE STORY
- firstChoice()
Advertisement
Add Comment
Please, Sign In to add comment