Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.36 KB | None | 0 0
  1. import time
  2. import random
  3. from random import randint
  4.  
  5. def story():
  6. print (' ')
  7. time.sleep(0.5)
  8. print ('\n;~~~~~~~~~~~~~~~~~~~~~;')
  9. print ('\n Adventures of Bob')
  10. print ('\n By: Amitesh and Roy')
  11. print ('\n;~~~~~~~~~~~~~~~~~~~~~;')
  12. time.sleep(4)
  13. print ("\n Chapter 1: Bob's Life")
  14. time.sleep(3)
  15. print ("\n The year was 1555 and there was a person named Bob. He lived on \n the new land of North America!")
  16. time.sleep(4)
  17. print ("\n He was a poor farmer who worked all day and was a hard worker.")
  18. time.sleep(3)
  19. print ("\n He never lies and helps other poor people with their jobs too!")
  20. time.sleep(3)
  21. print ("\n Later in the day, Bob was walking through the market to pick up \n some food until he overheard 2 fishermen talking about a giant clam with a \n shiny pearl worth a ton of money.")
  22. time.sleep(5)
  23. print ('\n Even though Bob is not a greedy person, he did want the pearl to \n to get money so he could live a good life.')
  24. time.sleep(4)
  25. print ('\n Bob starts to pack up for his trip and asks his friend if he can \n take care of his farm while he is gone.')
  26. time.sleep(4)
  27. print ('\n Bob takes his 2 horses and his wagon to make the journey a bit \n easier since he lives in the Prairies which is close to the middle of America.')
  28. time.sleep(5)
  29. print ('\n'*40)
  30. print ("\n Chapter 2: Bob's Adventure")
  31. time.sleep(3)
  32. print ('\n Next morning, he is fresh and ready to go on this possibly perilous journey')
  33. time.sleep(3)
  34. print ('\n He takes two of his horses and a wagon the carry supplies needed for his journey')
  35. time.sleep(3)
  36. print ('\n Just incase, he takes a look at his list.')
  37. time.sleep(2)
  38. print ('\n [Clothes, Sword, Bread, Money]')
  39. time.sleep(2)
  40. print ('\n Clothes, check, sword, check, bread, check, money, check!')
  41. time.sleep(3)
  42. print ('\n Well looks like he is done and ready to leave home.')
  43. time.sleep(3)
  44. print ('\n Bob says goodbye to his brother and starts to head east toward the Atlantic')
  45. time.sleep(3)
  46. print ('\n Bob goes through many places that he has never visited, such as \n random forests, weird and abandoned buildings, he even stumbled upon \n some murderers, and psychos along the way too!')
  47. time.sleep(6)
  48. print ('\n He beat death by a second each time he went through these areas \n with all of the killings.')
  49. time.sleep(4)
  50. print ('\n Everything was a mess! He lost a few supplies and a horse! So he \n was a bit sad but continued with the journey to find the pearl.')
  51. time.sleep(5)
  52. print ('\n While he walking, he stumbled upon of what seemed an old man.')
  53. time.sleep(3)
  54. print ('\n He looked at Bob like a carnivore but gently said, "Looking for your horse?"')
  55. time.sleep(3)
  56. print ('\n Bob replied saying, "Yes how did you know?"')
  57. time.sleep(3)
  58. print ('\n The man said, "He came to me and to get him back you must first \n do the challenge I say..."')
  59. time.sleep(4)
  60. print ('\n "Only then you will get the horse back."')
  61. time.sleep(2)
  62. print ('\n Bob stood there thinking about if it risked his life but he needed to horse to get to the Atlantic.')
  63. time.sleep(4)
  64. print ('\n "Ok!" Bob said standing there nervously.')
  65. time.sleep(2)
  66. print ('\n Bob was very nervous but he accepted it and was thinking very hard about it...')
  67. time.sleep(4)
  68. print ('\n "You will have to pick a number between 1 and 500..."')
  69. print ('\n Type in "guess()"')
  70.  
  71. def guess():
  72. random_number = random.randint(1,500)
  73. tries = 0
  74. tries_remaining = 5
  75. while tries < 5:
  76. guess = input("\n Pick a number between 1 and 500: ")
  77. tries += 1
  78. tries_remaining -= 1
  79.  
  80. try:
  81. guess_num = int(guess)
  82. except:
  83. print("\n That's not a whole number!")
  84. break
  85.  
  86. if not guess_num > 0 or not guess_num < 501:
  87. print("\n That number is not between 1 and 1000.")
  88. break
  89.  
  90.  
  91.  
  92. elif guess_num == random_number:
  93. print("\n Congratulations! You are correct! You may proceed!")
  94. print("\n It took you {} tries.".format(tries))
  95. print('\n Type in "resume()')
  96. break
  97.  
  98.  
  99. elif guess_num < random_number:
  100. if tries_remaining > 0:
  101. print("\n I'm sorry, that number is low. You have {} tries remaining.".format(int(tries_remaining)))
  102. continue
  103. else:
  104. print("\n Sorry, but my number was {}".format(random_number))
  105. print("\n You are out of tries...have fun in the after life!")
  106. print '\n Please RESTART the whole story'
  107.  
  108.  
  109. elif guess_num > random_number:
  110. if tries_remaining > 0:
  111. print("\n I'm sorry, that number is high. You have {} tries remaining.".format(int(tries_remaining)))
  112. continue
  113. else:
  114. print("\n Sorry, but my number was {}".format(random_number))
  115. print("\n You are out of tries...have fun in the after life!")
  116. print '\n Please RESTART the whole story'
  117.  
  118. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  119. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  120. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  121. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  122. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  123. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  124. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  125. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  126. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  127. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  128. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  129. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  130. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  131. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  132. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  133. #RESTART IF YOU DID NOT GET THE NUMBER RIGHT
  134.  
  135. def resume():
  136. print ('\n'*20)
  137. print ('\n Chapter 3: Bob Continues')
  138. time.sleep(3)
  139. print ('\n Lucky for Bob to guess the code right, he has survived death!')
  140. time.sleep(5)
  141. print ('\n The old man was surprised and let him walk through the gates.')
  142. time.sleep(5)
  143. print ('\n Bob was satisfied that he had beaten the old man and got his horse.')
  144. time.sleep(5)
  145. print ('\n He walked throught the glistening forest with magical orange trees.')
  146. time.sleep(4)
  147. print ('\n Eating his food, he felt he was slowing down! He noticed his horses are hungry!')
  148. time.sleep(5)
  149. print ('\n It was a smooth journey until he came upon another man!')
  150. time.sleep(4)
  151. print ('\n The man stopped him! And pointed him to a bridge that he MUST cross \n with a troll underneath.')
  152. time.sleep(5)
  153. print ('\n Bob walks over to the bridge and out pops a troll')
  154. time.sleep(3)
  155. print ('\n "WAKIE WAKIE SLEEPY DOOOO" He bellowed!')
  156. time.sleep(3)
  157. print ('\n Then suddenly, he was whisked away by a soaring eagle into the night sky!')
  158. time.sleep(5)
  159. print ('\n Then it turns out it was from a fantasy book and happened in real life')
  160. time.sleep(5)
  161. print ('\n Bob says," Life Hacks!"')
  162. time.sleep(3)
  163. print ('\n Then a man came from heaven and told Bob another challenge to do!')
  164. time.sleep(5)
  165. print ('\n "Not again!" said Bob.')
  166. time.sleep(3)
  167. print ('\n The man told him that he has to play a game of hangman and win!')
  168. time.sleep(5)
  169. print ('\n Type in "hangman()"')
  170.  
  171. def hangman():
  172. name = raw_input("What is your name? ")
  173. print "\n Hello, " + name, "Time to play hangman!"
  174. print " "
  175. time.sleep(1)
  176. print "\n Start guessing..."
  177. time.sleep(0.5)
  178. word = "\n secret"
  179. guesses = ''
  180. turns = 10
  181. while turns > 0:
  182. failed = 0
  183. for char in word:
  184. if char in guesses:
  185. print char,
  186.  
  187. else:
  188.  
  189. print "_",
  190. failed += 1
  191.  
  192. if failed == 0:
  193. print "\n You won!"
  194. print '\n Go ahead and type "resume2()'
  195. break
  196.  
  197. print
  198. guess = raw_input("Guess a character:")
  199. guesses += guess
  200.  
  201. if guess not in word:
  202. turns -= 1
  203. print "\n Wrong"
  204. print "\n You have", + turns, 'more guesses'
  205. if turns == 0:
  206. print "\n You Lose! Have fun in the afterlife..."
  207. print '\n Please RESTART the whole story'
  208.  
  209. #RESTART IF YOU DID NOT WIN
  210. #RESTART IF YOU DID NOT WIN
  211. #RESTART IF YOU DID NOT WIN
  212. #RESTART IF YOU DID NOT WIN
  213. #RESTART IF YOU DID NOT WIN
  214. #RESTART IF YOU DID NOT WIN
  215. #RESTART IF YOU DID NOT WIN
  216. #RESTART IF YOU DID NOT WIN
  217. #RESTART IF YOU DID NOT WIN
  218. #RESTART IF YOU DID NOT WIN
  219. #RESTART IF YOU DID NOT WIN
  220. #RESTART IF YOU DID NOT WIN
  221. #RESTART IF YOU DID NOT WIN
  222. #RESTART IF YOU DID NOT WIN
  223. #RESTART IF YOU DID NOT WIN
  224.  
  225. def resume2():
  226. print ('\n Chapter 4: Bob Still Continues')
  227. print ('\n Luckily, Bob was lucky to get past this guy too.')
  228. time.sleep(4)
  229. print ('\n He kept on trailing throught the forests, cities, and more places, \n and finally made it to the Atlantic and luckily made it to \n the "Rent-A-Boat-Dude" shop too!')
  230. time.sleep(12)
  231. print ('\n He quickly stepped first in line and rented a boat for 100 dollars.')
  232. time.sleep(6)
  233. print ('\n And he finally got the clam from fishing and he lived happily ever after.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement