Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Python syntax error

By: a guest on Jun 7th, 2013  |  syntax: Python  |  size: 11.51 KB  |  views: 71  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import random
  2.  
  3. x=0
  4. z=0
  5. monshp=random.randrange(10, 50)
  6. monsstr=random.randrange(1, 10)
  7. heroshp=random.randrange(10, 100)
  8. herostr=random.randrange(1, 20)
  9.  
  10. print("You spawn with " + str(heroshp) + " health and " + str(herostr) + " strength, your adventure begins now!")
  11.  
  12. if x==0 and z==0:
  13.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  14.  
  15. if direction==("attest"):
  16.         action=input("You are fighting ???, with " + str(monshp) + " HP! What do you do? ")
  17.         if action==("punch"):
  18.                 print("You punch the monster for " + str(herostr) + " damage!")
  19.                 monshp=monshp-herostr
  20.                 if monshp==0:
  21.                         print("You deal the final attack to the monster, it slumps to the ground and you feel as though you have become a more skilled fighter")
  22.         action=input("You are fighting ???, with " + str(monshp) + " HP! What do you do? ")
  23.         if action==("punch"):
  24.                 print("You punch the monster for " + str(herostr) + " damage!")
  25.                 monshp=monshp-herostr
  26.                 if monshp==0
  27.                         print("You deal the final attack to the monster, it slumps to the ground and you feel as though you have become a more skilled fighter")
  28.  
  29. if direction==("south"):
  30.         z=z-1
  31.  
  32. if direction==("east"):
  33.         x=x+1
  34.  
  35. if x==0 and z==-1:
  36.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  37.  
  38. if x==1 and z==0:
  39.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  40.  
  41. if direction==("north"):
  42.         z=z+1
  43.  
  44. if direction==("south"):
  45.         z=z-1
  46.  
  47. if direction==("east"):
  48.         x=x+1
  49.  
  50. if direction==("west"):
  51.         x=x-1
  52.  
  53. if x==0 and z==0:
  54.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  55.  
  56. if x==0 and z==-1:
  57.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  58.  
  59. if x==1 and z==0:
  60.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  61.  
  62. if x==1 and z==-1:
  63.         direction=input("You burst into the room, with determination flooding through you, you feel dissapointment replace it within seconds as you realise you have rushed into an empty room. Where will you go? ")
  64.  
  65. if direction==("north"):
  66.         z=z+1
  67.  
  68. if direction==("south"):
  69.         z=z-1
  70.  
  71. if direction==("east"):
  72.         x=x+1
  73.  
  74. if direction==("west"):
  75.         x=x-1
  76.  
  77. if x==0 and z==0:
  78.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  79.  
  80. if x==0 and z==-1:
  81.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  82.  
  83. if x==1 and z==0:
  84.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  85.  
  86. if x==1 and z==-1:
  87.         direction=input("You burst into the room, with determination flooding through you, you feel dissapointment replace it within seconds as you realise you have rushed into an empty room. Where will you go? ")
  88.  
  89. if direction==("north"):
  90.         z=z+1
  91.  
  92. if direction==("south"):
  93.         z=z-1
  94.  
  95. if direction==("east"):
  96.         x=x+1
  97.  
  98. if direction==("west"):
  99.         x=x-1
  100.  
  101. if x==0 and z==0:
  102.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  103.  
  104. if x==0 and z==-1:
  105.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  106.  
  107. if x==1 and z==0:
  108.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  109.  
  110. if x==1 and z==-1:
  111.         direction=input("You burst into the room, with determination flooding through you, you feel dissapointment replace it within seconds as you realise you have rushed into an empty room. Where will you go? ")
  112.  
  113. if direction==("north"):
  114.         z=z+1
  115.  
  116. if direction==("south"):
  117.         z=z-1
  118.  
  119. if direction==("east"):
  120.         x=x+1
  121.  
  122. if direction==("west"):
  123.         x=x-1
  124.  
  125. if x==0 and z==0:
  126.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  127.  
  128. if x==0 and z==-1:
  129.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  130.  
  131. if x==1 and z==0:
  132.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  133.  
  134. if x==1 and z==-1:
  135.         direction=input("You burst into the room, with determination flooding through you, you feel dissapointment replace it within seconds as you realise you have rushed into an empty room. Where will you go? ")
  136.  
  137. if direction==("north"):
  138.         z=z+1
  139.  
  140. if direction==("south"):
  141.         z=z-1
  142.  
  143. if direction==("east"):
  144.         x=x+1
  145.  
  146. if direction==("west"):
  147.         x=x-1
  148.  
  149. if x==0 and z==0:
  150.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  151.  
  152. if x==0 and z==-1:
  153.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  154.  
  155. if x==1 and z==0:
  156.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  157.  
  158. if x==1 and z==-1:
  159.         direction=input("You burst into the room, with determination flooding through you, you feel dissapointment replace it within seconds as you realise you have rushed into an empty room. Where will you go? ")
  160.  
  161. if direction==("north"):
  162.         z=z+1
  163.  
  164. if direction==("south"):
  165.         z=z-1
  166.  
  167. if direction==("east"):
  168.         x=x+1
  169.  
  170. if direction==("west"):
  171.         x=x-1
  172.  
  173. if x==0 and z==0:
  174.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  175.  
  176. if x==0 and z==-1:
  177.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  178.  
  179. if x==1 and z==0:
  180.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  181.  
  182. if x==1 and z==-1:
  183.         direction=input("You burst into the room, with determination flooding through you, you feel dissapointment replace it within seconds as you realise you have rushed into an empty room. Where will you go? ")
  184.  
  185. if direction==("north"):
  186.         z=z+1
  187.  
  188. if direction==("south"):
  189.         z=z-1
  190.  
  191. if direction==("east"):
  192.         x=x+1
  193.  
  194. if direction==("west"):
  195.         x=x-1
  196.  
  197. if x==0 and z==0:
  198.         direction=input("You are in a dark room with two doors, one leading to the south, and one to the east. The east door is decaying and there is no light filtering underneath it, while the south door looks like it has a fresh coat of paint and bright light coming from all around the door. Where will you go? ")
  199.  
  200. if x==0 and z==-1:
  201.         direction=input("You walk into the brightly lit room, as tantalizing rays wash over you, you breathe a sigh of relief. There is a comfortable looking chair on the far side of the room and a bookcase packed with expensive looking books, there is also a door to the north, aswell as the door to the east. Where will you go? ")
  202.  
  203. if x==1 and z==0:
  204.         direction=input("You creep into the dark room, making sure to be silent as you do, as your eyes adjust to the dark there is a lightning strike outside, the resulting flash illuminating a dark figure on the far side of the room. Where do you go? ")
  205.  
  206. if x==1 and z==-1:
  207.         direction=input("You burst into the room, with determination flooding through you, you feel dissapointment replace it within seconds as you realise you have rushed into an empty room. Where will you go? ")