Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. import time
  2. from random import randint
  3.  
  4.  
  5.  
  6. def easy():
  7. event = randint(1,10)
  8. cornersTurned = 0
  9. death = False
  10.  
  11. print("You enter the maze...")
  12. time.sleep(2)
  13. while cornersTurned < 5 and death != True:
  14. print("You reach a corner")
  15. print("You can turn left (L) or right (R)")
  16. direction = input()
  17. print("You turn the corner...")
  18. time.sleep(3)
  19. if event <= 8:
  20. print("Nothing happens and you continue")
  21. cornersTurned = cornersTurned + 1
  22. event = randint(1,10)
  23. else:
  24. print("You get crushed")
  25. death = True
  26. if cornersTurned == 5:
  27. print("You've reached the end, well done")
  28. if death == True:
  29. print("Try again")
  30.  
  31. def medium():
  32.  
  33. event = randint(1,10)
  34. cornersTurned = 0
  35. death = False
  36.  
  37. print("You enter the maze...")
  38. time.sleep(2)
  39. while cornersTurned < 5 and death != True:
  40. print("You reach a corner")
  41. print("You can turn left (L) or right (R)")
  42. direction = input()
  43. print("You turn the corner...")
  44. time.sleep(3)
  45. if event <= 6:
  46. print("Nothing happens and you continue")
  47. cornersTurned = cornersTurned + 1
  48. event = randint(1,10)
  49. else:
  50. print("You get crushed")
  51. death = True
  52. if cornersTurned == 5:
  53. print("You've reached the end, well done")
  54. if death == True:
  55. print("Try again")
  56.  
  57. def hard():
  58.  
  59. event = randint(1,10)
  60. cornersTurned = 0
  61. death = False
  62.  
  63. print("You enter the maze...")
  64. time.sleep(2)
  65. while cornersTurned < 5 and death != True:
  66. print("You reach a corner")
  67. print("You can turn left (L) or right (R)")
  68. direction = input()
  69. print("You turn the corner...")
  70. time.sleep(3)
  71. if event <= 4:
  72. print("Nothing happens and you continue")
  73. cornersTurned = cornersTurned + 1
  74. event = randint(1,10)
  75. else:
  76. print("You get crushed")
  77. death = True
  78. if cornersTurned == 5:
  79. print("You've reached the end, well done")
  80. if death == True:
  81. print("Try again")
  82.  
  83.  
  84. print("======================================================")
  85. print("¦Pick your difficulty: [1] Easy [2] Medium [3] Hard¦")
  86. print("======================================================")
  87. difficulty = input("-> ")
  88.  
  89. while not difficulty.isdigit():
  90. print("Enter a number from 1 - 3")
  91. difficulty = int(input("-> "))
  92. if int(difficulty) == 1:
  93. easy()
  94. elif int(difficulty) == 2:
  95. medium()
  96. elif int(difficulty) == 3:
  97. hard()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement