Advertisement
Guest User

asfasf

a guest
Jun 26th, 2019
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.20 KB | None | 0 0
  1.  
  2.  
  3. places_to_visit_in_hallway = ('upper', 'lower', 'room1', 'room2', 'room3', 'room4')
  4. valid_places_for_room1 = ('sofa', 'table', 'TV', 'Playstation4', 'bookshelf')
  5. location = 'hallway'
  6. inventory = []
  7. entrance_map = ('|Livingroom|', '|', 'Hallway', '|', '|Kitchen|\n',
  8. '|Hallway|', ' ', ' ' '|'' Hallway', '|', '|Hallway|\n',
  9. '|Diningroom|', '|', 'Entrance', '|', '|Family Room|\n'
  10. )
  11. help = ('If you are outside a room:\n'
  12. 'Type - go to and state a destination\n'
  13. 'If you are inside a room:\n'
  14. 'Type - go to and state a destination\n'
  15. 'or\n'
  16. 'Type - take and specify what\n'
  17. 'If you are inside or outside a room:\n'
  18. 'Type - map - shows you the surroundings\n'
  19. 'Type - inventory - shows you what your inventory contains\n'
  20. 'Type - go to upper/lower if you want to change to floor')
  21.  
  22.  
  23. class InputHandler:
  24. @staticmethod
  25. def Input():
  26. command = input()
  27. commandarray = command.split()
  28. return commandarray
  29.  
  30. @staticmethod
  31. def check_input(location, commandarray):
  32. if location == "hallway":
  33. if commandarray[0] == 'HELP':
  34. print("({})".format("".join(help)))
  35. elif commandarray[0] == 'go':
  36. FirstFloor.go_function(commandarray)
  37. elif commandarray[0] == 'map':
  38. print("({})".format("".join(entrance_map)))
  39. elif commandarray[0] == 'inventory':
  40. print(inventory)
  41. else:
  42. print("You have entered a invalid command!")
  43. elif location == 'room1':
  44. FirstFloor.entering_Room_one()
  45. elif location == 'room2':
  46. FirstFloor.entering_Room_two()
  47. elif location == 'room3':
  48. FirstFloor.entering_Room_three()
  49. elif location == 'room4':
  50. FirstFloor.entering_Room_four()
  51.  
  52.  
  53. class FirstFloor:
  54. def __init__(self, inventory, location):
  55. self.inventory = inventory
  56. self.location = location
  57.  
  58. @staticmethod
  59. def floor_message():
  60. print("WELCOME PLAYER ! You are currently on the first\n"
  61. "floor and this is where your journey begins\n"
  62. "I wish you good luck and have fun !\n"
  63. "Start playing by typing a desired command\n"
  64. "if you don't know what to type, please type\n"
  65. "'HELP' to check the commands.")
  66.  
  67. @staticmethod
  68. def handle_desk():
  69. print("You come to the desk and look\n"
  70. "at the computer, but it only has\n"
  71. "ubuntu on it, so you can't even\n"
  72. "play some game on it...")
  73. print("What do you want to do now?")
  74. command = InputHandler.Input()
  75. FirstFloor.action_in_fourth_room(command)
  76.  
  77. @staticmethod
  78. def handle_bed():
  79. print("You come to the bed and see a old\n"
  80. "tetris on it. You play a little bit\n"
  81. "but it crashes, just before you can\n"
  82. "beat the highscore, so you get angry\n"
  83. "and start wanting to leave this house\n"
  84. "even more than before")
  85. print("What do you want to do now ?")
  86. command = InputHandler.Input()
  87. FirstFloor.action_in_fourth_room(command)
  88.  
  89. @staticmethod
  90. def entering_Room_four():
  91. print("Do you wish to enter the room ?\n"
  92. "Yes or No")
  93. command = input()
  94. if command == 'Yes':
  95. location = "room4"
  96. print("Once in the fourth room\n"
  97. "you see a bed on your left\n"
  98. "in front of the bed there is a\n"
  99. "desk with a computer on it")
  100. fourth_room_commands = InputHandler.Input()
  101. FirstFloor.action_in_fourth_room(fourth_room_commands)
  102.  
  103. else:
  104. print("Are you sure you don't want to enter ?\n"
  105. "Yes or No ? for the last time..")
  106. command = input()
  107.  
  108. if command == 'Yes':
  109. print("Ok, you are going back to the Hallway")
  110. print("What do you wish to do now ?")
  111. location = 'hallway'
  112. variable = InputHandler.Input()
  113. InputHandler.check_input(location, variable)
  114.  
  115. else:
  116. print("Once in the fourth room\n"
  117. "you see a bed on your left\n"
  118. "in front of the bed there is a\n"
  119. "desk with a computer on it")
  120. print("What do you chose to do now ?")
  121. fourth_room_commands = InputHandler.Input()
  122. FirstFloor.action_in_fourth_room(fourth_room_commands)
  123.  
  124. @staticmethod
  125. def action_in_fourth_room(fourth_room_commands):
  126. valid_places = ('bed', 'desk')
  127. while FirstFloor.check_commands_for_fourth_room(fourth_room_commands, valid_places):
  128. command = input()
  129. fourth_room_commands = command.split()
  130.  
  131. @staticmethod
  132. def check_commands_for_fourth_room(fourth_room_commands,valid_places):
  133. if fourth_room_commands[0] == 'HELP':
  134. print("({})".format("".join(help)))
  135.  
  136. if fourth_room_commands[0] == 'leave':
  137. print("You have left the room\n"
  138. "and are back in the hallway\n"
  139. "what do you want to do now ?")
  140. location = 'hallway'
  141. InputHandler.check_input(location, InputHandler.Input())
  142.  
  143. if fourth_room_commands[0] == 'map':
  144. print("Once in the fourth room\n"
  145. "you see a bed on your left\n"
  146. "in front of the bed there is a\n"
  147. "desk with a computer on it")
  148.  
  149. if fourth_room_commands[0] == 'inventory':
  150. print(inventory)
  151.  
  152. if len(fourth_room_commands) < 2:
  153. print("You didn't enter enough commands.\n"
  154. "Please type HELP if you don't know what to type!")
  155.  
  156. elif len(fourth_room_commands) == 2:
  157. if fourth_room_commands[1] == 'to':
  158. print("You didn't state your destination!\n"
  159. "Please state where you want to go!")
  160.  
  161. else:
  162. print("Invalid command! Please type HELP if you don't know the commands!")
  163.  
  164. elif len(fourth_room_commands) == 3:
  165.  
  166. if fourth_room_commands[2] in valid_places:
  167. print("You are going to " + fourth_room_commands[2])
  168. if fourth_room_commands[2] == 'bed':
  169. FirstFloor.handle_bed()
  170.  
  171. elif fourth_room_commands[2] == 'desk':
  172. FirstFloor.handle_desk()
  173.  
  174. else:
  175. print("You have entered a invalid third statement.\n"
  176. "Maybe you meant to write: bed\n"
  177. "desk")
  178.  
  179. else:
  180. print("You have entered a invalid second statement.\n"
  181. "Maybe you meant to write: to")
  182.  
  183.  
  184. @staticmethod
  185. def handle_inflatablebed():
  186. print("You come to the bed and look around\n"
  187. "it but you don't notice anything special,\n"
  188. "besides the fact of how smelly it is..")
  189. print("What do you want to do now?")
  190. command = InputHandler.Input()
  191. FirstFloor.action_in_third_room(command)
  192.  
  193. @staticmethod
  194. def entering_Room_three():
  195. print("Do you wish to enter the room ?\n"
  196. "Yes or No")
  197. command = input()
  198. if command == 'Yes':
  199. location = "room3"
  200. print("Once in the third room\n"
  201. "you notice that there is only a\n"
  202. "inflatable bed on the middle of the room")
  203. third_room_commands = InputHandler.Input()
  204. FirstFloor.action_in_third_room(third_room_commands)
  205.  
  206. else:
  207. print("Are you sure you don't want to enter ?\n"
  208. "Yes or No ? for the last time..")
  209. command = input()
  210.  
  211. if command == 'Yes':
  212. print("Ok, you are going back to the Hallway")
  213. print("What do you wish to do now ?")
  214. location = 'hallway'
  215. variable = InputHandler.Input()
  216. InputHandler.check_input(location, variable)
  217.  
  218. else:
  219.  
  220. print("Once in the third room\n"
  221. "you notice that there is only a\n"
  222. "inflatable bed on the middle of the room")
  223. print("What do you chose to do now ?")
  224. third_room_commands = InputHandler.Input()
  225. FirstFloor.action_in_third_room(third_room_commands)
  226.  
  227. @staticmethod
  228. def action_in_third_room(third_room_commands):
  229. valid_places = ('inflatablebed')
  230. while FirstFloor.check_commands_for_third_room(third_room_commands, valid_places):
  231. command = input()
  232. third_room_commands = command.split()
  233.  
  234. @staticmethod
  235. def check_commands_for_third_room(third_room_commands,valid_places):
  236. if third_room_commands[0] == 'HELP':
  237. print("({})".format("".join(help)))
  238.  
  239.  
  240. if third_room_commands[0] == 'leave':
  241. print("You have left the room\n"
  242. "and are back in the hallway\n"
  243. "what do you want to do now ?")
  244. location = 'hallway'
  245. InputHandler.check_input(location, InputHandler.Input())
  246.  
  247. if third_room_commands[0] == 'map':
  248. print("Once in the third room\n"
  249. "you notice that there is only a\n"
  250. "inflatable bed on the middle of the room")
  251.  
  252.  
  253. if third_room_commands[0] == 'inventory':
  254. print(inventory)
  255.  
  256. if len(third_room_commands) < 2:
  257. print("You didn't enter enough commands.\n"
  258. "Please type HELP if you don't know what to type!")
  259.  
  260. elif len(third_room_commands) == 2:
  261. if third_room_commands[1] == 'to':
  262. print("You didn't state your destination!\n"
  263. "Please state where you want to go!")
  264.  
  265. else:
  266. print("Invalid command! Please type HELP if you don't know the commands!")
  267.  
  268. elif len(third_room_commands) == 3:
  269.  
  270. if third_room_commands[2] in valid_places:
  271. print("You are going to " + third_room_commands[2])
  272. if third_room_commands[2] == 'inflatablebed':
  273. FirstFloor.handle_inflatablebed()
  274.  
  275. else:
  276. print("You have entered a invalid third statement.\n"
  277. "Maybe you meant to write: inflatablebed")
  278.  
  279. else:
  280. print("You have entered a invalid second statement.\n"
  281. "Maybe you meant to write: to")
  282.  
  283.  
  284. @staticmethod
  285. def handle_oven():
  286. if "SecondRoom-Key" in inventory:
  287. print("You already came here and took\n"
  288. "the key... What more do you want from\n"
  289. "an oven ?")
  290. print("What do you want to do now?")
  291. command = InputHandler.Input()
  292. FirstFloor.action_in_second_room(command)
  293. else:
  294. print("The oven is a bit rusty so\n"
  295. "you can't see inside, do you\n"
  296. "wish to open it ?")
  297. command = input("Yes or No?: ")
  298. if command == "Yes":
  299. print("You open the oven and find\n"
  300. "a key.")
  301. command = input("Do you wish to take it? Yes/No ?")
  302. if command == "Yes":
  303. print("You took this key inside your inventory !\n"
  304. "You can now check your inventory to see\n"
  305. "the items inside!")
  306. inventory.append("SecondRoom-Key")
  307. print("What do you want to do now?")
  308. command = InputHandler.Input()
  309. FirstFloor.action_in_second_room(command)
  310. else:
  311. print("Well ok, what do you want to do now, crazy head ?")
  312. command = InputHandler.Input()
  313. FirstFloor.action_in_second_room(command)
  314. else:
  315. print("Ok, what do you want to do now ?")
  316. command = InputHandler.Input()
  317. FirstFloor.action_in_second_room(command)
  318.  
  319. @staticmethod
  320. def handle_secondtable():
  321. print("You come to the table and see\n"
  322. "that it has some writing carved\n"
  323. "on it. You read the following:"
  324. "\"What is useful, but burns when,\n"
  325. "you're not careful\"")
  326. print("What do you wish to do now ?")
  327. command = InputHandler.Input()
  328. FirstFloor.action_in_second_room(command)
  329.  
  330. @staticmethod
  331. def handle_drawers():
  332. print("You come to drawers and open\n"
  333. "each one, but the only things\n"
  334. "you can find are knives and forks\n")
  335. command = input("Do you wish to take one of the knives ? Yes/No?")
  336. if command == "Yes":
  337. #this knife will be used on the last floor to open the easter egg
  338. print("Ok, now you have your knife in your inventory")
  339. inventory.append("knive")
  340. print("What do you want to do now?")
  341. command = InputHandler.Input()
  342. FirstFloor.action_in_second_room(command)
  343. else:
  344. print("Ok, then, what do you want to do now ?")
  345. command = InputHandler.Input()
  346. FirstFloor.action_in_second_room(command)
  347.  
  348. @staticmethod
  349. def handle_washingmachine():
  350. print("You come to the washing machine\n"
  351. "and manage to open it, but unfortunately\n"
  352. "as you expected, you find nothing other than\n"
  353. "dirty dishes")
  354. print("What do you want to do now?")
  355. command = InputHandler.Input()
  356. FirstFloor.action_in_second_room(command)
  357.  
  358. @staticmethod
  359. def entering_Room_two():
  360. print("Do you wish to enter the room ?\n"
  361. "Yes or No")
  362. command = input()
  363. if command == 'Yes':
  364. location = "room2"
  365. print("Once in the second room you look around\n"
  366. "and see a table in the middle of the room\n"
  367. "and on your right you have a couple of\n"
  368. "half closed drawers, on your left there\n"
  369. "is a oven and washing machine")
  370.  
  371. second_room_commands = InputHandler.Input()
  372. FirstFloor.action_in_second_room(second_room_commands)
  373.  
  374. else:
  375. print("Are you sure you don't want to enter ?\n"
  376. "Yes or No ? for the last time..")
  377. command = input()
  378.  
  379. if command == 'Yes':
  380. print("Ok, you are going back to the Hallway")
  381. print("What do you wish to do now ?")
  382. location = 'hallway'
  383. variable = InputHandler.Input()
  384. InputHandler.check_input(location, variable)
  385.  
  386. else:
  387. print("Once in the second room you look around\n"
  388. "and see a table in the middle of the room\n"
  389. "and on your right you have a couple of\n"
  390. "half closed drawers, on your left there\n"
  391. "is a oven and washing machine")
  392. print("What do you chose to do now ?")
  393. second_room_commands = InputHandler.Input()
  394. FirstFloor.action_in_second_room(second_room_commands)
  395.  
  396. @staticmethod
  397. def action_in_second_room(second_room_commands):
  398. valid_places = ('drawers','table','washingmachine','oven')
  399. while FirstFloor.check_commands_for_second_room(second_room_commands, valid_places):
  400. command = input()
  401. second_room_commands = command.split()
  402.  
  403. @staticmethod
  404. def check_commands_for_second_room(second_room_commands,valid_places):
  405. if second_room_commands[0] == 'HELP':
  406. print("({})".format("".join(help)))
  407.  
  408.  
  409. if second_room_commands[0] == 'leave':
  410. print("You have left the room\n"
  411. "and are back in the hallway\n"
  412. "what do you want to do now ?")
  413. location = 'hallway'
  414. InputHandler.check_input(location, InputHandler.Input())
  415.  
  416. if second_room_commands[0] == 'map':
  417. print("Once in the second room you look around\n"
  418. "and see a table in the middle of the room\n"
  419. "and on your right you have a couple of\n"
  420. "half closed drawers, on your left there\n"
  421. "is a oven and washing machine")
  422.  
  423. if second_room_commands[0] == 'inventory':
  424. print(inventory)
  425.  
  426. if len(second_room_commands) < 2:
  427. print("You didn't enter enough commands.\n"
  428. "Please type HELP if you don't know what to type!")
  429.  
  430. elif len(second_room_commands) == 2:
  431. if second_room_commands[1] == 'to':
  432. print("You didn't state your destination!\n"
  433. "Please state where you want to go!")
  434.  
  435. else:
  436. print("Invalid command! Please type HELP if you don't know the commands!")
  437.  
  438. elif len(second_room_commands) == 3:
  439.  
  440. if second_room_commands[2] in valid_places:
  441. print("You are going to " + second_room_commands[2])
  442. if second_room_commands[2] == 'oven':
  443. FirstFloor.handle_oven()
  444.  
  445. elif second_room_commands[2] == 'table':
  446. FirstFloor.handle_secondtable()
  447.  
  448. elif second_room_commands[2] == 'drawers':
  449. FirstFloor.handle_drawers()
  450.  
  451. elif second_room_commands[2] == 'washingmachine':
  452. FirstFloor.handle_washingmachine()
  453.  
  454. else:
  455. print("You have entered a invalid third statement.\n"
  456. "Maybe you meant to write: table\n"
  457. "drawers\n"
  458. "oven\n"
  459. "washingmachine\n")
  460.  
  461. else:
  462. print("You have entered a invalid second statement.\n"
  463. "Maybe you meant to write: to")
  464.  
  465.  
  466. @staticmethod
  467. def handle_sofa():
  468. print("You look around the sofa, but\n"
  469. "unfortunately there seems to be\n"
  470. "no clues here")
  471. print("What do you wish to do now ?")
  472. first_room_commands = InputHandler.Input()
  473. FirstFloor.action_in_first_room(first_room_commands)
  474.  
  475. @staticmethod
  476. def handle_table():
  477. print("You came to the table and\n"
  478. "took the letter from it.\n"
  479. "Once you open the letter,\n"
  480. "you find the following message: \n"
  481. "\"Get busy living or get busy dying\"")
  482. print("Hmmm.. this seems to be some sort of a clue..")
  483. print("What do you wish to do now?")
  484. first_room_commands = InputHandler.Input()
  485. FirstFloor.action_in_first_room(first_room_commands)
  486.  
  487. @staticmethod
  488. def handle_TV():
  489. print("You came to look at the TV\n"
  490. "but unfortunately there isn't \n"
  491. "any clue here..")
  492. print("What do you wish to do now?")
  493. first_room_commands = InputHandler.Input()
  494. FirstFloor.action_in_first_room(first_room_commands)
  495.  
  496. @staticmethod
  497. def handle_playstation():
  498. print("You came to look at the PS\n"
  499. "but you saw that it had only \n"
  500. "fifa 2019, so it was in no interest\n"
  501. "to you..")
  502. print("What do you wish to do now?")
  503. first_room_commands = InputHandler.Input()
  504. FirstFloor.action_in_first_room(first_room_commands)
  505.  
  506. @staticmethod
  507. def handle_bookshelf():
  508. print("You come to the bookshelf and see\n"
  509. "a couple of books. The authors of the \n"
  510. "books are \"Stephen King\",\n"
  511. "\"Hamlet\", \"Ivan Vazov\"")
  512.  
  513. print("Do you wish to grab one of the books ?")
  514. command = input("Yes or No ? ")
  515. if command == 'Yes':
  516. print("Which author's book do you wish to grab ?")
  517. command = input("Type Stephen or Hamlet or Ivan Vazov")
  518. if command == 'Stephen':
  519. if "clue" in inventory:
  520. print("You already opened King's\n"
  521. "book, you crazy.\n"
  522. "Now what is the next adequate thing you want to do ?")
  523. command = InputHandler.Input()
  524. FirstFloor.action_in_first_room(command)
  525. else:
  526. print("You opened Stephen King's book\n"
  527. "inside you found a key and a clue that says the following: \n"
  528. "\"Escape comes for those who never fear going up\"")
  529. print("Do you wish to take the key with you?")
  530. command = input("Type 'take key' if you wish to take it")
  531. if command =='take key':
  532. inventory.append('key')
  533. print("You can now check your inventory to see what items\n"
  534. "you have inside it!")
  535. print("What do you wish to do now ?")
  536. first_room_commands = InputHandler.Input()
  537. FirstFloor.action_in_first_room(first_room_commands)
  538.  
  539. else:
  540. print("Guess you have good memory, what do you want to do now ?")
  541. first_room_commands = InputHandler.Input()
  542. FirstFloor.action_in_first_room(first_room_commands)
  543. else:
  544. print("You open the book, but find nothing special in it")
  545. print("What do you want to do now? You can return\n"
  546. "to the bookshelf to try another book")
  547. first_room_commands = InputHandler.Input()
  548. FirstFloor.action_in_first_room(first_room_commands)
  549.  
  550. else:
  551. print("Ok then, what do you wish to do now ?")
  552. first_room_commands = InputHandler.Input()
  553. FirstFloor.action_in_first_room(first_room_commands)
  554.  
  555. @staticmethod
  556. def go_function(commandarray):
  557. if len(commandarray) < 2:
  558. print("You didn't enter enough commands.\n"
  559. "Please type HELP if you don't know what to type!")
  560.  
  561. elif len(commandarray) == 2:
  562. if commandarray[1] == 'to':
  563. print("You didn't state your destination!\n"
  564. "Please state where you want to go!")
  565.  
  566. else:
  567. print("Invalid command! Please type HELP if you don't know the commands!")
  568.  
  569. elif len(commandarray) == 3:
  570. if commandarray[2] == 'upper':
  571. if 'key' in inventory:
  572. print("Ok you are going to the second floor")
  573.  
  574. else:
  575. print("You have to find the key for the second\n"
  576. "floor, before you can go there")
  577.  
  578.  
  579. if commandarray[2] == 'lower':
  580. if 'basement-key' in inventory:
  581. print("Ok you are going to the basement")
  582.  
  583. else:
  584. print("You have to find the key for the basement,\n"
  585. "before you can go there")
  586.  
  587.  
  588. if commandarray[2] in places_to_visit_in_hallway:
  589. print("You are going to " + commandarray[2])
  590. location = commandarray[2]
  591. InputHandler.check_input(location, commandarray[2])
  592.  
  593. else:
  594. print("You have entered a invalid third statement.\n"
  595. "Maybe you meant to write: upper\n"
  596. "lower\n"
  597. "first room->room1\n"
  598. "second room->room2\n"
  599. "third room->room3\n"
  600. "fourth room->room4")
  601.  
  602. else:
  603. print("You have entered a invalid second statement.\n"
  604. "Maybe you meant to write: to")
  605.  
  606.  
  607. @staticmethod
  608. def entering_Room_one():
  609. print("Do you wish to enter the room ?\n"
  610. "Yes or No")
  611. command = input()
  612. if command == 'Yes':
  613. location = 'room1'
  614. print("You have entered the first room!\n"
  615. "In front of you, on the left side of the room,\n"
  616. "there is a sofa with a coffee table\n"
  617. "in front of it. On the right of the room\n"
  618. "in front of the coffee table there is a\n"
  619. "playstation4 with a TV. At the end of the room\n"
  620. "right in front of you, there is a book shelf.\n"
  621. "The first thing you notice is that there is a\n"
  622. "LETTER on the coffe table")
  623. print("What do you chose to do now ?")
  624. first_room_commands = InputHandler.Input()
  625. FirstFloor.action_in_first_room(first_room_commands)
  626.  
  627. else:
  628. print("Are you sure you don't want to enter ?\n"
  629. "Yes or No ? for the last time..")
  630. command = input()
  631.  
  632. if command == 'Yes':
  633. print("Ok, you are going back to the Hallway")
  634. print("What do you wish to do now ?")
  635. location = 'hallway'
  636. variable = InputHandler.Input()
  637. InputHandler.check_input(location, variable)
  638.  
  639. else:
  640. print("You have entered the first room!\n"
  641. "In front of you, on the left side of the room,\n"
  642. "there is a sofa with a coffee table\n"
  643. "in front of it. On the right of the room\n"
  644. "in front of the coffee table there is a\n"
  645. "playstation4 with a TV. At the end of the room\n"
  646. "right in front of you, there is a book shelf.\n"
  647. "The first thing you notice is that there is a\n"
  648. "LETTER on the coffe table")
  649. print("What do you chose to do now ?")
  650. first_room_commands = InputHandler.Input()
  651. FirstFloor.action_in_first_room(first_room_commands)
  652.  
  653. @staticmethod
  654. def action_in_first_room(first_room_commands):
  655. valid_places = ('sofa','table','TV','Playstation4','bookshelf')
  656. while FirstFloor.check_commands_for_first_room(first_room_commands, valid_places):
  657. command = input()
  658. first_room_commands = command.split()
  659.  
  660. @staticmethod
  661. def check_commands_for_first_room(first_room_commands,valid_places):
  662. if first_room_commands[0] == 'HELP':
  663. print("({})".format("".join(help)))
  664.  
  665.  
  666. if first_room_commands[0] == 'leave':
  667. print("You have left the room\n"
  668. "and are back in the hallway\n"
  669. "what do you want to do now ?")
  670. location = 'hallway'
  671. InputHandler.check_input(location, InputHandler.Input())
  672.  
  673. if first_room_commands[0] == 'map':
  674. print("You have entered the first room!\n"
  675. "In front of you, on the left side of the room,\n"
  676. "there is a sofa with a coffee table\n"
  677. "in front of it. On the right of the room\n"
  678. "in front of the coffee table there is a\n"
  679. "playstation4 with a TV. At the end of the room\n"
  680. "right in front of you, there is a book shelf.\n"
  681. "The first thing you notice is that there is a\n"
  682. "LETTER on the coffe table")
  683.  
  684. if first_room_commands[0] == 'inventory':
  685. print(inventory)
  686.  
  687. if len(first_room_commands) < 2:
  688. print("You didn't enter enough commands.\n"
  689. "Please type HELP if you don't know what to type!")
  690.  
  691. elif len(first_room_commands) == 2:
  692. if first_room_commands[1] == 'to':
  693. print("You didn't state your destination!\n"
  694. "Please state where you want to go!")
  695.  
  696. else:
  697. print("Invalid command! Please type HELP if you don't know the commands!")
  698.  
  699. elif len(first_room_commands) == 3:
  700.  
  701. if first_room_commands[2] in valid_places:
  702. print("You are going to " + first_room_commands[2])
  703. if first_room_commands[2] == 'sofa':
  704. FirstFloor.handle_sofa()
  705.  
  706. elif first_room_commands[2] == 'table':
  707. FirstFloor.handle_table()
  708.  
  709. elif first_room_commands[2] == 'TV':
  710. FirstFloor.handle_TV()
  711.  
  712. elif first_room_commands[2] == 'bookshelf':
  713. FirstFloor.handle_bookshelf()
  714.  
  715. elif first_room_commands[2] == 'Playstation4':
  716. FirstFloor.handle_playstation()
  717.  
  718. else:
  719. print("You have entered a invalid third statement.\n"
  720. "Maybe you meant to write: sofa\n"
  721. "table\n"
  722. "bookshelf\n"
  723. "TV\n"
  724. "Playstation4\n")
  725.  
  726. else:
  727. print("You have entered a invalid second statement.\n"
  728. "Maybe you meant to write: to")
  729.  
  730.  
  731.  
  732. FirstFloor([], '').floor_message()
  733. variable = InputHandler.Input()
  734. secondvariable = InputHandler.check_input(location, variable)
  735.  
  736. while secondvariable:
  737. variable = InputHandler.Input()
  738. secondvariable = InputHandler.check_input(location, variable)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement