Guest User

Untitled

a guest
Jun 25th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. outer = False
  2. while outer == False:
  3. room_list = []
  4. room = ["This place stinks, better get moving. Door to the N or E", 1, 8, None, None]
  5. room_list.append(room)
  6. room = ["You are in a safe room. There are doors to the N,E,S and W", 2, 9, 0, 4]
  7. room_list.append(room)
  8. room = ["This room is filled with garbage. There is a door to the S", None, None, 1, None]
  9. room_list.append(room)
  10. room = ["You encounter goblins and die!"]
  11. room_list.append(room)
  12. room = ["You encounter orcs and kill them all! There is a door to the N,E and S", 3, 1, 5, None]
  13. room_list.append(room)
  14. room = ["You encounter rats, easy fight. Theres a door to the N", 4, None, 7, None]
  15. room_list.append(room)
  16. room = ["You found a companion! Theres a door to the S", None, None, 9, None]
  17. room_list.append(room)
  18. room = ["You found the treasure! Congratulations!"]
  19. room_list.append(room)
  20. room = ["Ouch, you were hit by a fireball! There's a door to the W", None, None, None, 0]
  21. room_list.append(room)
  22. room = ["You found a treasure map! It says 'Rats dwell, south it lies'. Theres a door to the N and W",6,None,None,1]
  23. room_list.append(room)
  24. current_room = 0
  25. print (room_list[current_room][0])
  26. inner = False
  27. new_room = 0
  28. while inner == False:
  29. user_choice = input ("What would you like to do? ")
  30. print ()
  31. if user_choice in('north','n','North','N'):
  32. new_room = room_list[current_room][1]
  33. elif user_choice in('east','e','East','E'):
  34. new_room = room_list[current_room][2]
  35. elif user_choice in('south','s','South','S'):
  36. new_room = room_list[current_room][3]
  37. elif user_choice in('west','w','West','W'):
  38. new_room = room_list[current_room][4]
  39. else:
  40. print ("I don't know what", user_choice, "means")
  41.  
  42. if new_room == None:
  43. print ("You can't go that way.")
  44. else:
  45. current_room = new_room
  46. print (room_list[new_room][0])
  47.  
  48.  
  49. if current_room == 3:
  50. play_again = input("Would you like to play again? ")
  51. if play_again in("y","Y","Yes","yes"):
  52. print()
  53. break
  54. else:
  55. outer = True
  56. break
  57. if current_room == 7:
  58. outer = True
  59. break
Add Comment
Please, Sign In to add comment