Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. def show_status():
  2. print("nThis is the " + rooms[current_room]["name"])
  3.  
  4.  
  5.  
  6. rooms = {
  7.  
  8. 1 : { "name" : "Highway" ,
  9. "west" : 2 ,
  10. "east" : 2 ,
  11. "north": 2 ,
  12. "south": 2} ,
  13. 2 : { "name" : "Forest" ,
  14. "west" : 1 ,
  15. "east" : 1 ,
  16. "north": 1 ,
  17. "south": 1} ,
  18. }
  19.  
  20. current_room = 1
  21.  
  22. while True:
  23.  
  24. show_status()
  25.  
  26. move = input(">> ").lower().split()
  27.  
  28.  
  29. if move[0] == "go":
  30. if move[1] in rooms[current_room]:
  31. current_room = rooms[current_room][move[1]]
  32. else:
  33. print("you can't go that way!")
  34. else:
  35. print("You didn't type anything!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement