Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. from sys import exit
  2. import random
  3.  
  4. wumpus_room = random.randint(0, 3)
  5. rooms = ["North", "East", "South", "West"]
  6.  
  7. def center_room():
  8.     print "You find yourself in a large cavern."
  9.     print "There are passages dug into the North, South, East, and West walls."
  10.     print "The Wumpus you have chased into this cavern could be down any of these passages."
  11.     print "You may peer into, shoot into or walk into the passages to the North,."
  12.     print "South, East, or West. For example peer north, or walk east, or shoot west."
  13.     print "\n"
  14.    
  15.     choice = raw_input("> ")
  16.    
  17.     if choice.lower() == "peer north":
  18.         if rooms[wumpus_room] == "North":
  19.             print("You see vague movements in the shadows")
  20.         else:
  21.             print("Nothing seems amiss")          
  22.        
  23.     elif choice.lower() == "shoot north":
  24.         # check for win or put the Wumpus somewhere else
  25.         if rooms[wumpus_room] == "North":
  26.             print "You killed the wumpus!"
  27.             exit(0)
  28.         else:
  29.             print "You missed! The wumpus could be anywhere now!!!"
  30.             wumpus_room = random.randint(0, 3)            
  31.          
  32.     else:
  33.         print "I don't understand...\n"
  34.         center_room()
  35.            
  36. center_room()