MrThoe

Untitled

Sep 6th, 2019
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. """
  2. This is a framework for a python story that does nothing
  3. Author: Allen Thoe
  4. Date: 9/6/2019
  5. """
  6.  
  7. def greeting():
  8. print("Hello, this is the story preface....")
  9. theName = input("What is your name? ")
  10. return theName
  11.  
  12. #IN THIS EXAMPLE THERE IS NO RECURSION IF THEY TYPE IT WRONG
  13. def firstChoice():
  14. x = input("Hi " + name + ". Would you like to 'go' or 'stay'")
  15. if(x == 'go'):
  16. go()
  17. else:
  18. stay()
  19. #IN THIS EXAMPLE< RECURSION FORCES THE USER TO ANSWER A SPECIFIC WAY
  20. def go():
  21. print("You went")
  22. x = input("Ok " + name + ", Would you like to 'fight' or 'run': ")
  23. if(x == "fight"):
  24. fight()
  25. elif(x == "run"):
  26. run()
  27. else:
  28. print("I am sorry, I don't understand that.")
  29. print("Please only respond with 'fight' or 'run': ")
  30. go()
  31. def stay():
  32. print("You died...sorry")
  33.  
  34. def run():
  35. print("You are a coward. Goodbye")
  36.  
  37. def fight():
  38. print("You are brave but you die anyway. Goodbye")
  39.  
  40. #THIS CREATES A PERSONALIZED VARIABLE TO BE USED THROUGHOUT THE STORY
  41. name = greeting()
  42.  
  43. #INITIALIZE THE STORY
  44. firstChoice()
Advertisement
Add Comment
Please, Sign In to add comment