#######################################################################
#                              ESCAPE                                 #
#######################################################################
# Michael D. McKinney
# January 14, 2021
# (Updated December 11, 2023 - fixed some typos and changed debug to
# be disabled by default.)
# (Updated May 11, 2024 - fixed a typo.)
#
# A simple text adventure game that showcases the elements of a text
# adventure game such as movement, inventory, game states, clearing of 
# screen, saving and loading save files, debugging/debug mode, etc.
#
# There are five rooms in this text adventure.
#
# To enable debug mode - make sure the debug flag is set to 1, then type
# "xyzzy" at any time during the game.
#
# To save/load game, type "save" or "load" at any time during the game.
# (Save files generated by this game is compatible with C version of 
# Escape.)
#
# I have tried to anticipate everything a player could type in the game 
# and developed a response for each potential input.
#
# Walkthrough - E, TAKE PAPER, PRESS YELLOW, PRESS GREEN, W, N, OPEN PANEL,
# PRESS BLACK, CLOSE PANEL, S, S, TAKE PLANTER, TAKE BRASS, TAKE RUBBISH,
# OPEN PANEL, PRESS RED, PRESS BLUE, CLOSE PANEL, N, E, OPEN BOX, TAKE KEY,
# CLOSE BOX, PRESS YELLOW, PRESS GREEN, W, N, OPEN PANEL, PRESS BLACK, 
# CLOSE PANEL, OPEN BOX WITH ALUMINUM KEY, TAKE BATTERIES, S, S, OPEN PANEL, 
# PRESS BLUE, CLOSE PANEL, N, E, OPEN BOX, PRESS YELLOW, W, 
# INSERT BATTERIES INTO FLASHLIGHT, W, TURN FLASHLIGHT ON, 
# OPEN BOX WITH BRASS KEY, TAKE KEY, CLOSE BOX, TURN FLASHLIGHT OFF, E, E,
# CLOSE BOX, PRESS YELLOW, PRESS GREEN, W, N, UNLOCK GATE WITH IRON, N.
#


#######################################################################
#                           DEBUG FLAG                                #
#######################################################################
# 0 = DISABLED, 1 = ENABLED.  ENTER XYZZY AT ANY TIME DURING THE GAME
# TO ACCESS THE DEBUG MENU.
debugflag = 0

#######################################################################
#            IMPORTING VARIOUS STUFF NEEDED FOR ESCAPE                #
#######################################################################
from operator import and_
from os import system, name

#######################################################################
#                        CLEAR SCEEN FUNCTION                         #
#######################################################################
def clear(): 
  
    # WINDOWS
    if name == 'nt': 
        _ = system('cls') 
  
    # MAC AND LINUX
    else: 
        _ = system('clear') 

#######################################################################
#                            GAME STATES                              #
#######################################################################
# roomid - 1-5 (1 = Center Room, 2 = East Room, 3 = West Room, 
# 4 = South Room, and 5 = North Room.  0 = Opening, 6 = Ending.)
# northdoor, southdoor, eastdoor, westdoor - 0 (locked) or 1 (unlocked).
# steelbox, titaniumbox and tungstengate - 0 (locked) or 1 (unlocked/open)
# northaccesspanel - 0 (closed) or 1 (open)
# southaccesspanel - 0 (closed/locked), 1 (closed/unlocked) or 2 (open)
# deadplant and planter - 0 (still intact) or 1 (crumbled)
# flashlight - 0 (off) or 1 (on)
# flashlight batteries - 0 (not inserted) or 1 (inserted)
# escaped - 0 (not escaped) or 1 (escaped)
game_states = {"roomid": 0, "northdoor": 0, "southdoor": 0, "eastdoor": 1, 
"westdoor": 0, "bronzebox": 0, "northaccesspanel": 0, "steelbox": 0, 
"southaccesspanel": 1, "deadplant": 0, "planter": 0, "flashlight": 0, 
"flashlightbatteries": 0, "titaniumbox": 0, "tungstengate": 0, "escaped": 0}

#######################################################################
#                            INVENTORY                                #
#######################################################################
inventory = []

#######################################################################
#                              OPENING                                #
#######################################################################
def opening():

	clear()
	
	print("\t\t-----------------------------------------------")
	print("\t\t\t\t   ESCAPE")
	print("\t\t-----------------------------------------------")
	game_states["roomid"] = 0

	print('\n\nSomehow you have ended up in this strange area.')
	print('\nYou have no recollection of how you ended up in here, '
	      '\nbut you do know that you need to escape.')
	print('\nCan you escape?')
	print('\n\nPress enter to begin the game or type "HELP"'
		  ' and press enter to see \ninstruction on how to '
          'interact with the game.')
	
	while True:
		player_input = input("\n> ")
		player_input = player_input.strip()		
		player_input = player_input.lower()

		# PLAYER WANTED TO SEE INSTRUCTION ("HELP")
		if player_input == "help":

			clear()
			
			print("\t\t-----------------------------------------------")
			print("\t\t\t\t   ESCAPE")
			print("\t\t-----------------------------------------------")      
			print('\n"Escape" is a text advetnure game. You type what you '
				  'would like to do.')
			print("\nHere's a list of commands you can type in the game:")
			print('LOOK, TAKE, PRESS, PUSH, SEARCH, INSERT, OPEN, CLOSE, '
				  '\nTURN ON, TURN OFF, USE, UNLOCK')
			print('\nSome examples of commands: LOOK DIAMOND, TAKE DIAMOND,')
			print('OPEN BOX WITH KEY, TURN ON LANTERN, INSERT COIN INTO TUBE')
			print('\nAvoid using words such as "the", "a", "an", and "at". '
				  'Keep it simple.')
			print('\nType "n" or "north", "s" or "south", "e" or "east", and '
				  '"w" or "west" \nto go to a room in that direction.')                 
			print('\nType "inventory" or "i" to see your inventory at any '
				  'time.')     
			print('\nType "save" or "load" to save/load the save file at '
				  'any time.')  				           
			print('\nType "quit" or "q" to quit the game at any time.')         
			print('\nPress enter to begin the game.')

			input("\n")
			centerroom()

		# DEBUG 
		if (player_input == "xyzzy" and debugflag != 0):
			debug()

		# SAVE
		if player_input == "save":
			saveGame()	

		# LOAD
		if player_input == "load":
			loadGame()				

		# QUIT
		if (player_input == "q" or player_input == "quit"):
			end()

		# GO TO CENTER ROOM (BEGIN THE GAME)
		else:
			centerroom()

#######################################################################
#                            CENTER ROOM                              #
#######################################################################
def centerroom():

	clear()
	
	print("\t\t-----------------------------------------------")
	print("\t\t\t\t CENTER ROOM")
	print("\t\t-----------------------------------------------")
	print("\nYou're in the center room.")
	game_states["roomid"] = 1

	# LIGHT ABOVE THE DOOR  (RED IS LOCKED, GREEN IS UNLOCKED.)
	if game_states["northdoor"] == 0:
		print("The light above the door in the north is red.")

	if game_states["northdoor"] != 0:
		print("The light above the door in the north is green.")

	if game_states["southdoor"] == 0:
		print("The light above the door in the south is red.")

	if game_states["southdoor"] != 0:
		print("The light above the door in the south is green.")

	if game_states["eastdoor"] == 0:
		print("The light above the door in the east is red.")

	if game_states["eastdoor"] != 0:
		print("The light above the door in the east is green.")	

	if game_states["westdoor"] == 0:
		print("The light above the door in the west is red.")

	if game_states["westdoor"] != 0:
		print("The light above the door in the west is green.")

	# MAIN SECTION OF THE CENTER ROOM FUNCTION															
	while True:

		# GET PLAYER'S INPUT AND CLEAN IT
		player_input = input("\n> ")
		player_input = player_input.strip()
		player_input = player_input.lower()		

		# LOOK / LOOK ROOM
		if (player_input == 'look' or 
		    player_input == 'look room'):

			print("The walls, doors, ceiling, and floor are metal.")
			print("There is a light source on the ceiling.")
			print("It looks like a very bright LED embedded in the ceiling.")
			print("There are four doors here, with a light above it.")

			if game_states["northdoor"] == 0:
					print("The light above the door in the north is red.")

			if game_states["northdoor"] != 0:
					print("The light above the door in the north is green.")

			if game_states["southdoor"] == 0:
					print("The light above the door in the south is red.")

			if game_states["southdoor"] != 0:
					print("The light above the door in the south is green.")

			if game_states["eastdoor"] == 0:
					print("The light above the door in the east is red.")

			if game_states["eastdoor"] != 0:
					print("The light above the door in the east is green.")	

			if game_states["westdoor"] == 0:
					print("The light above the door in the west is red.")

			if game_states["westdoor"] != 0:
					print("The light above the door in the west is green.")	

			if game_states["flashlight"] != 0:
				print("Light is shining from the flashlight.")	

			continue

		# INPUT HANDLER
		else:
			inputhandler(player_input)
			continue

#######################################################################
#                             EAST ROOM                               #
#######################################################################
def eastroom():

	clear()
	
	print("\t\t-----------------------------------------------")
	print("\t\t\t\t EAST ROOM")
	print("\t\t-----------------------------------------------")
	print("\nYou're in the east room.")
	game_states["roomid"] = 2

    # LOCK THE DOOR AS SOON AS THE PLAYER ENTERS THE ROOM
	game_states["eastdoor"] = 0
	print("As soon as the door behind you closes, the light above the door turns red.")

	# LIGHT ABOVE THE DOOR  (RED IS LOCKED, GREEN IS UNLOCKED.)
	if game_states["eastdoor"] == 0:
		print("The light above the door in the west is red.")	

	if game_states["eastdoor"] != 0:
		print("The light above the door in the west is green.")	

	# BRONZE BOX - ALUMINUM KEY INSIDE THE BOX
	print("There is a bronze box on the floor in center of the room.")

	if game_states["bronzebox"] != 2:
		print("The lid on the bronze box is closed.")		

	if game_states["bronzebox"] == 2:
		print("The lid on the bronze box is open.")	

		if "aluminum key" not in inventory:
			print("There is an aluminum key inside the bronze box.")

		if "aluminum key" in inventory:
			print("The bronze box is empty.")

	# PAPER - COVERING THE YELLOW SWITCH
	if "paper" not in inventory:
			print("There is a paper on the floor in the southeast corner.")	

	if "paper" in inventory:
			print("There is a yellow switch on floor in the southeast corner.")			

	# GREEN SWITCH - UNLOCKS NORTH DOOR
	print("There is a green switch on the north wall.")		

	# MAIN SECTION OF THE EAST ROOM FUNCTION																
	while True:

		# GET PLAYER'S INPUT AND CLEAN IT#
		player_input = input("\n> ")
		player_input = player_input.strip()
		player_input = player_input.lower()	

		# LOOK / LOOK ROOM
		if (player_input == 'look' or 
			player_input == 'look room'):

			print("The walls, door, ceiling, and floor are metal.")
			print("There is a light source on the ceiling.")
			print("It looks like a very bright LED embedded in the ceiling.")
			print("There is a door in the west.")	

			if game_states["eastdoor"] == 0:
				print("The light above the door is red.")

			if game_states["eastdoor"] != 0:
				print("The light above the door is green.")	

			print("There is a green switch on the north wall.")

			if "paper" not in inventory:
				print("There is a paper on the floor in southeast corner.")

			if "paper" in inventory:
				print("There is a yellow switch on the floor in southeast corner.")				

			print("There is a bronze box in the center of the room.")

			if game_states["bronzebox"] != 2:
				print("The bronze box is currently closed.")

			if game_states["bronzebox"] == 2:
				print("The bronze box is currently open.")	

				if "aluminum key" not in inventory:
					print("There is an aluminum key inside the bronze box.")

				if "aluminum key" in inventory:
					print("The bronze box is empty.")

			if game_states["flashlight"] != 0:
				print("Light is shining from the flashlight.")	

			continue								

		# INPUT HANDLER
		else:
			inputhandler(player_input)
			continue				

#######################################################################
#                            NORTH ROOM                               #
#######################################################################
def northroom():

	clear()
	
	print("\t\t-----------------------------------------------")
	print("\t\t\t\t NORTH ROOM")
	print("\t\t-----------------------------------------------")
	print("\nYou're in the north room.")
	game_states["roomid"] = 5

	# LOCK EAST DOOR UPON ENTRY INTO NORTH ROOM
	print("Upon entering the room, you stepped on a pressure switch on the floor.")
	game_states["eastdoor"] = 0

	# DOOR LIGHT STATE	
	if game_states["northdoor"] == 0:
			print("The light above the door in the south is red.")

	if game_states["northdoor"] != 0:
			print("The light above the door in the south is green.")		

	# PASSAGE TO THE EXIT
	print("You can see the passage to the exit in the north.")
	print("There is an impassable thick tungsten gate blocking the passage.")
	print("There is a keyhole on the tungsten gate.")

	# ACCESS PANEL STATUS
	if game_states["northaccesspanel"] == 0:
		print("There is a metal access panel on the west wall.  It is currently closed.")	

	if game_states["northaccesspanel"] != 0:
		print("There is a metal access panel on the west wall.  It is currently open.")
		print("You can see black and white switches inside the metal access panel.")

	# STEEL BOX STATUS
	print("There is a steel box on the floor in center of the room.")
	print("There is a keyhole on a side of the steel box.")		

	if game_states["steelbox"] == 0:
		print("The steel box is currently closed.")

	if game_states["steelbox"] == 1:
		print("The steel box is currently open.")

		if "batteries" not in inventory:
			print("There are several batteries inside the steel box.")

		if "batteries" in inventory:
			print("The steel box is empty.")	

	# MAIN SECTION OF THE NORTH ROOM FUNCTION  															
	while True:

		# GET PLAYER'S INPUT AND CLEAN IT
		player_input = input("\n> ")
		player_input = player_input.strip()
		player_input = player_input.lower()					

		# LOOK / LOOK ROOM
		if (player_input == 'look' or 
			player_input == 'look room'):

			print("The walls, door, ceiling, and floor are metal.")
			print("There is a light source on the ceiling.")
			print("It looks like a very bright LED embedded in the ceiling.")		
			print("There is a door in the south.")	

			if game_states["northdoor"] == 0:
				print("The light above the door is red.")

			if game_states["northdoor"] != 0:
				print("The light above the door is green.")	

			print("A tungsten gate is blocking the passage to the exit in the north.")			
			print("There is a steel box in the center of the room.")

			if game_states["steelbox"] == 0:
				print("The steel box is currently closed.")	

			if game_states["steelbox"] != 0:
				print("The steel box is currently open.")

				if "batteries" not in inventory:
					print("There are batteries in the steel box.")

				if "batteries" in inventory:
					print("The steel box is empty.")	

			print("There is a metal access panel on the west wall.")

			if game_states["northaccesspanel"] == 0:
				print("The access panel is currently closed.")

			if game_states["northaccesspanel"] == 1:
				print("The metal access panel is currently open.")	
				print("You can see black and white switches inside the metal access panel.")

			if game_states["flashlight"] != 0:
				print("Light is shining from the flashlight.")	

			continue																										

		# INPUT HANDLER
		else:
			inputhandler(player_input)
			continue											

#######################################################################
#                            SOUTH ROOM                               #
#######################################################################
def southroom():

	clear()
	
	print("\t\t-----------------------------------------------")
	print("\t\t\t\t SOUTH ROOM")
	print("\t\t-----------------------------------------------")
	print("\nYou're in the south room.")
	game_states["roomid"] = 4

	print("It's quite messy in here.")

	# DOOR LIGHT STATE 	      	 	
	if game_states["southdoor"] == 0:
			print("The light above the door in the north is red.")

	if game_states["southdoor"] != 0:
			print("The light above the door in the north is green.")	

	# METAL ACCESS PANEL
	print("There is a metal access panel on the west wall.")

	if game_states["southaccesspanel"] != 2:
		print("The metal access panel is currently closed.")

	if game_states["southaccesspanel"] == 2:
		print("The metal access panel is currently open.")
		print("You can see a blue switch and a red switch inside the metal access panel.")

	# ITEMS IN THE ROOM
	print("Several large gears are stacked in the northeast corner.")					      	
	print("Springs of varying sizes are scattered everywhere in the room.")
	print("Rubbish are piled up in the southwest corner.")

	# DEAD PLANT INSIDE PLANTER - PLANT/PLANTER INTACT
	if game_states["deadplant"] == 0 and game_states["planter"] == 0:
		print("A large planter with a dead and decaying plant is in southeast corner.")

	# DEAD PLANT CRUMBLED, PLANTER INTACT
	if game_states["deadplant"] != 0 and game_states["planter"] == 0:
		print("A large planter with a pile of dust on it is in southeast corner.")

	# PLANTER CRUMBLED, DEAD PLANT AUTOMATICALLY CRUMBLED
	if game_states["planter"] == 1:
		print("There is a pile of dirt is in southeast corner.")
		if "brass key" not in inventory:
			print("A brass key is partially buried in the pile of dirt.")

	# MAIN SECTION OF THE SOUTH ROOM FUNCTION														
	while True:

		# GET PLAYER'S INPUT AND CLEAN IT
		player_input = input("\n> ")
		player_input = player_input.strip()
		player_input = player_input.lower()	

		# LOOK / LOOK ROOM
		if (player_input == 'look' or 
			player_input == 'look room'):

			print("It's quite messy in here.")			
			print("The walls, door, ceiling, and floor are metal.")
			print("There is a light source on the ceiling.")
			print("It looks like a very bright LED embedded in the ceiling.")
			print("There is a door in the north.")	

			if game_states["southdoor"] == 0:
				print("The light above the door is red.")

			if game_states["southdoor"] != 0:
				print("The light above the door is green.")		

			if game_states["planter"] == 0 and game_states["deadplant"] == 0:
				print("There is a planter in southeast corner with a dead plant in it.")

			if game_states["planter"] == 0 and game_states["deadplant"] != 0:
				print("There is a planter in southeast corner with a pile of dust in it.")	

			if game_states["planter"] != 0:
				print("There is a pile of dirt in southeast corner.")	

				if "brass key" not in inventory:
					print("A brass key is partially buried in pile of dirt.")

			print("There is a pile of rubbish in southwest corner.")
			print("Gears are stacked in northeast corner.")
			print("Springs are scattered all over the room.")
			print("There is a metal access panel on the west wall.")

			if (game_states["southaccesspanel"] != 2):
				print("The metal access panel is currently closed.")

			if (game_states["southaccesspanel"] == 2):
				print("The metal access panel is currently open.")	
				print("You can see a blue switch and a red switch inside the metal access panel.")

			if game_states["flashlight"] != 0:
				print("Light is shining from the flashlight.")		

			continue									

		# INPUT HANDLER
		else:
			inputhandler(player_input)
			continue		

#######################################################################
#                             WEST ROOM                               #
#######################################################################
def westroom():

	clear()
	
	print("\t\t-----------------------------------------------")
	print("\n\t\t\t\t WEST ROOM\n")
	print("\t\t-----------------------------------------------")
	print("\nYou're in the west room.")
	game_states["roomid"] = 3

	if game_states["flashlight"] == 0 and game_states["titaniumbox"] == 0:
		game_states["westdoor"] = 1

	if game_states["flashlight"] != 0 or game_states["titaniumbox"] != 0:
		game_states["westdoor"] = 0

	if game_states["flashlight"] == 0:
		print("It's pitch black in here.")

		if game_states["westdoor"] == 0:
			print("The only source of light is a dim red light above the door in the east.")

		if game_states["westdoor"] != 0:
			print("The only source of light is a dim green light above the door in the east.")

	if game_states["flashlight"] != 0:	
		print("The flashlight is illuminating the room.")

		if game_states["westdoor"] == 0:
			print("The light above the door in the east is red.")

		if game_states["westdoor"] != 0:
			print("The light above the door in the east is green.")

		print("There is a sensor on the ceiling.")
		print("There is a titanium box on the floor in the center of the room.")
		print("There is a keyhole on a side of the titanium box.")

		if game_states["titaniumbox"] == 0:
			print("The titanium box is closed.")

		if game_states["titaniumbox"] != 0:
			print("The titanium box is open.")

			if "iron key" not in inventory:
				print("There is an iron key inside the titanium box.")

			if "iron key" in inventory:
				print("The titanium box is empty.")

	# MAIN SECTION OF THE WEST ROOM FUNCTION
	while True:

		# GET PLAYER'S INPUT AND CLEAN IT
		player_input = input("\n> ")
		player_input = player_input.strip()
		player_input = player_input.lower()

		# FLASHLIGHT IS OFF, NO ACTION CAN BE DONE EXCEPT TURNING 
		# FLASHLIGHT ON/OFF OR GOING EAST
		# INPUT HANDLER DISABLED
		if game_states["flashlight"] == 0: 

			# EAST
			if player_input == 'e' or player_input == 'east':

				if game_states["westdoor"] == 0:
					print("The door is locked, you can't go east.")
					continue

				if game_states["westdoor"] != 0:
					centerroom()	

			# NORTH
			if player_input == 'n' or player_input == 'north':

				print("Groping around in the darkness, you find "
					  "that there is no route north from here.")

				continue

			# SOUTH
			if player_input == 's' or player_input == 'south':

				print("Groping around in the darkness, you find "
					  "that there is no route south from here.")

				continue

			# WEST
			if player_input == 'w' or player_input == 'west':

				print("Groping around in the darkness, you find "
					  "that there is no route west from here.")

				continue

			# LOOK / LOOK ROOM
			if player_input == 'look' or player_input == 'look room':

				print("It's too dark to see anything.")

				if game_states["westdoor"] == 0:

					print("The only source of light is a dim red light "
						  "above the door in the east.")

				if game_states["westdoor"] != 0:	

					print("The only source of light is a dim green light "
						  "above the door in the east.")	

				continue			

			# FLASHLIGHT
			if (player_input == "turn on flashlight" or 
				player_input == "turn flashlight on" or
				player_input == "turn light on" or
				player_input == "turn on light"):

				if "flashlight" in inventory:

					if game_states["flashlightbatteries"] != 0:
						game_states["flashlight"] = 1
						westroom()

					if game_states["flashlightbatteries"] == 0:
						print("Flashlight won't turn on.  There are no "
							  "batteries inside it.")

				if "flashlight" not in inventory:
					if (player_input == "turn on flashlight" or 
						player_input == "turn flashlight on"):
						print("What flashlight?")

					if (player_input == "turn on light" or 
						player_input == "turn light on"):
						print("What light?")

				continue					

			# QUIT THE GAME
			if player_input == 'q' or player_input == 'quit':
				end()		

			# DEBUG
			if player_input == 'xyzzy' and debugflag != 0:
				debug()		

			# SAVE
			if player_input == 'save':
				saveGame()		

			# LOAD
			if player_input == 'load':
				loadGame()								

			# CATCH-ALL FOR ALL OTHER INPUTS
			# INPUT HANDLER DISABLED WHEN ROOM IS DARK
			else:
				print("It's too dark to do anything.")
				continue		

		# FLASHLIGHT IS ON, INPUT HANDLER IS ENABLED AGAIN
		if game_states["flashlight"] != 0:

			# LOOK / LOOK ROOM
			if (player_input == 'look' or 
				player_input == 'look room'):

				print("The walls, door, ceiling, and floor are metal.")
				print("There is no light anywhere in the room except for the "
					  "light \nabove the door in the east and the flashlight.")
				print("There is a door to the east.")	

				if game_states["westdoor"] == 0:
					print("The light above the door in the east is red.")

				if game_states["westdoor"] != 0:
					print("The light above the door in the east is green.")	

				print("There is a titanium box in the center of the room.")	

				if game_states["titaniumbox"] == 0:
					print("The titanium box is currently closed.") 

				if game_states["titaniumbox"] != 0:
					print("The titanium box is currently open.")  

					if "iron key" not in inventory:
						print("There is an iron key inside the titanium box.")

					if "iron key" in inventory:
						print("The titanium box is empty.")   

				continue        					
							
		# INPUT HANDLER
			else:
				inputhandler(player_input)
				continue			
								
#######################################################################
#                          INPUT HANDLER                              #
#######################################################################
def inputhandler(player_input):

		# SAVE
		if player_input == 'save':
			saveGame()
			return()	

		# LOAD
		if player_input == 'load':
			loadGame()
			return()

		# DEBUG
		if player_input == 'xyzzy' and debugflag != 0:
			debug()
			return()

		# INVENTORY
		if player_input == 'inventory' or player_input == 'i':
			playerinventory()
			return()

		# NORTH
		if player_input == 'n' or player_input == 'north':

			if game_states["roomid"] == 1:	

				if game_states["northdoor"] == 0:
					print("The north door is locked.")

				if game_states["northdoor"] != 0:
					northroom()	

			if (game_states["roomid"] == 2 or 
				game_states["roomid"] == 3):	

				print("There is no route north from here.")

			if game_states["roomid"] == 4:	

				if game_states["southdoor"] == 0:
					print("The north door is locked.")

				if game_states["southdoor"] != 0:
					centerroom()

			if game_states["roomid"] == 5:		

				if game_states["tungstengate"] == 0:
					print("The tungsten gate is locked.")

				if game_states["tungstengate"] != 0:
					game_states["escaped"] = 1
					end()

			return()

		# SOUTH
		if player_input == 's' or player_input == 'south':
			if game_states["roomid"] == 1:	
				if game_states["southdoor"] == 0:
					print("The south door is locked.")
				if game_states["southdoor"] != 0:
					southroom()	
			if (game_states["roomid"] == 2 or 
				game_states["roomid"] == 3 or 
				game_states["roomid"] == 4):	
				print("There is no route south from here.")
			if game_states["roomid"] == 5:		
				if game_states["northdoor"] == 0:
					print("The south door is locked.")
				if game_states["northdoor"] != 0:
					centerroom()	
			return()

		# EAST
		if player_input == 'e' or player_input == 'east':

			if game_states["roomid"] == 1:	

				if game_states["eastdoor"] == 0:
					print("The east door is locked.")

				if game_states["eastdoor"] != 0:
					eastroom()	

			if (game_states["roomid"] == 2 or 
				game_states["roomid"] == 4 or 
				game_states["roomid"] == 5):	

				print("There is no route east from here.")

			if game_states["roomid"] == 3:		

				if game_states["westdoor"] == 0:
					print("The east door is locked.")

				if game_states["westdoor"] != 0:
					centerroom()

			return()

		# WEST
		if player_input == 'w' or player_input == 'west':

			if game_states["roomid"] == 1:	

				if game_states["westdoor"] == 0:
					print("The west door is locked.")

				if game_states["westdoor"] != 0:
					westroom()	

			if game_states["roomid"] == 2:	

				if game_states["eastdoor"] == 0:
					print("The west door is locked.")

				if game_states["eastdoor"] != 0:
					centerroom()	

			if (game_states["roomid"] == 3 or 
				game_states["roomid"] == 4 or 
				game_states["roomid"] == 5):	

				print("There is no route west from here.")	

			return()	

		# LOOK TUNGSTEN GATE
		if (player_input == 'look tungsten gate' or
			player_input == 'look tungsten' or
			player_input == "look gate"):

			if game_states["roomid"] == 5:	
				print("Peering through the tungsten gate and squinting to see beyond "
					   "the passage, \nyou can see blue sky and grassy meadows.")
				print("There is a keyhole on the tungsten gate.")

			if game_states["roomid"] != 5:

				if player_input == 'look tungsten gate':
					print("There isn't any tungsten gate here.")

				if player_input == 'look tungsten':
					print("There isn't anything tungsten in here.")	

				if player_input == 'look gate':
					print("There isn't any gate here.")

			return()

		# UNLOCK TUNGSTEN GATE WITH KEY / UNLOCK GATE WITH KEY
		if (player_input == 'use key on tungsten gate' or 
			player_input == 'use key on gate' or
			player_input == 'use key on tungsten' or			
			player_input == 'use key to open tungsten gate' or 
			player_input == 'use key to open tungsten' or			
			player_input == 'use key to open gate' or  
			player_input == 'use key to unlock tungsten gate' or 
			player_input == 'use key to unlock gate' or
			player_input == 'use key to unlock tungsten' or			 			
			player_input == 'open tungsten gate with key' or 
			player_input == 'open gate with key' or 
			player_input == 'open tungsten with key' or 			
			player_input == 'open tungsten gate using key' or 
			player_input == 'open gate using key' or 
			player_input == 'open tungsten using key' or 			
			player_input == 'unlock tungsten gate using key' or 
			player_input == 'unlock gate using key' or 
			player_input == 'unlock tungsten using key' or 			
			player_input == 'unlock tungsten gate with key' or 
			player_input == 'unlock gate with key' or 			
			player_input == 'unlock tungsten with key'):	

			if game_states["roomid"] == 5:	

				if ("iron key" in inventory or
					"brass key" in inventory or
					"aluminum key" in inventory):

					print("Please specify which key to use.")
	
				if ("iron key" not in inventory and
					"brass key" not in inventory and
					"aluminum key" not in inventory):

					print("What key?")

			if game_states["roomid"] != 5:	

				if (player_input == 'use key on gate' or 
					player_input == 'use key to open gate' or  
					player_input == 'open gate with key' or 
					player_input == 'open gate using key' or 
					player_input == 'unlock gate using key' or 
					player_input == 'unlock gate with key' or 			
					player_input == 'use key to unlock gate'):

					print("There isn't any gate here.")

				if (player_input == 'use key on tungsten' or 
					player_input == 'use key to open tungsten' or
					player_input == 'open tungsten with key' or 
					player_input == 'open tungsten using key' or 
					player_input == 'unlock tungsten using key' or 
					player_input == 'unlock tungsten with key' or 			
					player_input == 'use key to unlock tungsten'):

					print("There isn't anything tungsten in here.")

				if (player_input == 'use key on tungsten gate' or 
					player_input == 'use key to open tungsten gate' or  
					player_input == 'open tungsten gate with key' or 
					player_input == 'open tungsten gate using key' or 
					player_input == 'unlock tungsten gate using key' or 
					player_input == 'unlock tungsten gate with key' or 			
					player_input == 'use key to unlock tungsten gate'):

					print("There isn't any tungsten gate here.")

				if ("iron key" not in inventory and
					"brass key" not in inventory and
					"aluminum key" not in inventory):

					print("What key?")

			return()	

		# UNLOCK TUNGSTEN GATE WITH ALUMINUM KEY
		if (player_input == 'use aluminum key on tungsten gate' or 
			player_input == 'use aluminum key on gate' or		
			player_input == 'use aluminum key on tungsten' or 
			player_input == 'use aluminum on gate' or				
			player_input == 'use aluminum on tungsten' or 				
			player_input == 'use aluminum on tungsten gate' or 						
			player_input == 'use aluminum key to open tungsten gate' or 
			player_input == 'use aluminum key to open gate' or 
			player_input == 'use aluminum key to open tungsten' or 
			player_input == 'use aluminum to open gate' or			
			player_input == 'use aluminum to open tungsten' or
			player_input == 'use aluminum to open tungsten gate' or			
			player_input == 'use aluminum key to unlock tungsten gate' or 
			player_input == 'use aluminum key to unlock gate' or
			player_input == 'use aluminum key to unlock tungsten' or 	
			player_input == 'use aluminum to unlock gate' or			
			player_input == 'use aluminum to unlock tungsten' or		
			player_input == 'use aluminum to unlock tungsten gate' or													 
			player_input == 'open tungsten gate with aluminum key' or 
			player_input == 'open gate with aluminum key' or 		
			player_input == 'open tungsten with aluminum key' or 	
			player_input == 'open gate with aluminum' or				
			player_input == 'open tungsten with aluminum' or 	
			player_input == 'open tungsten gate with aluminum' or 								
			player_input == 'open tungsten gate using aluminum key' or 
			player_input == 'open gate using aluminum key' or 		
			player_input == 'open tungsten using aluminum key' or 	
			player_input == 'open gate using aluminum' or				
			player_input == 'open tungsten using aluminum' or 	
			player_input == 'open tungsten gate using aluminum' or 					
			player_input == 'unlock tungsten gate with aluminum key' or 
			player_input == 'unlock gate with aluminum key' or 		
			player_input == 'unlock tungsten with aluminum key' or 	
			player_input == 'unlock gate with aluminum' or				
			player_input == 'unlock tungsten with aluminum' or 	
			player_input == 'unlock tungsten gate with aluminum' or 								
			player_input == 'unlock tungsten gate using aluminum key' or 
			player_input == 'unlock gate using aluminum key' or 		
			player_input == 'unlock tungsten using aluminum key' or 	
			player_input == 'unlock gate using aluminum' or				
			player_input == 'unlock tungsten using aluminum' or 	
			player_input == 'unlock tungsten gate using aluminum'):

			if (game_states["roomid"] == 5 and 
				"aluminum key" in inventory):

				print("Aluminum key doesn't fit in the keyhole on the tungsten gate.")

			if game_states["roomid"] != 5:

				if (player_input == 'use aluminum key on gate' or		
					player_input == 'use aluminum on gate' or										
					player_input == 'use aluminum key to open gate' or 
					player_input == 'use aluminum to open gate' or			
					player_input == 'use aluminum key to unlock gate' or
					player_input == 'use aluminum to unlock gate' or			
					player_input == 'open gate with aluminum key' or 		
					player_input == 'open gate with aluminum' or				
					player_input == 'open gate using aluminum key' or 			
					player_input == 'open gate using aluminum' or				
					player_input == 'unlock gate with aluminum key' or 		
					player_input == 'unlock gate with aluminum' or				
					player_input == 'unlock gate using aluminum key' or 			
					player_input == 'unlock gate using aluminum'):	

					print("There isn't any gate here.")

				if (player_input == 'use aluminum key on tungsten gate' or 		
					player_input == 'use aluminum on tungsten gate' or 						
					player_input == 'use aluminum key to open tungsten gate' or 
					player_input == 'use aluminum to open tungsten gate' or			
					player_input == 'use aluminum key to unlock tungsten gate' or 	
					player_input == 'use aluminum to unlock tungsten gate' or													 
					player_input == 'open tungsten gate with aluminum key' or 			
					player_input == 'open tungsten gate with aluminum' or 								
					player_input == 'open tungsten gate using aluminum key' or 		
					player_input == 'open tungsten gate using aluminum' or 					
					player_input == 'unlock tungsten gate with aluminum key' or 
					player_input == 'unlock tungsten gate with aluminum' or 								
					player_input == 'unlock tungsten gate using aluminum key' or 	
					player_input == 'unlock tungsten gate using aluminum'):

					print("There isn't any tungsten gate here.")

				if (player_input == 'use aluminum key on tungsten' or 		
					player_input == 'use aluminum on tungsten' or 				
					player_input == 'use aluminum key to open tungsten' or 		
					player_input == 'use aluminum to open tungsten' or
					player_input == 'use aluminum key to unlock tungsten' or 			
					player_input == 'open tungsten with aluminum key' or 				
					player_input == 'open tungsten with aluminum' or 			
					player_input == 'open tungsten using aluminum key' or 				
					player_input == 'open tungsten using aluminum' or 		
					player_input == 'unlock tungsten with aluminum key' or 				
					player_input == 'unlock tungsten with aluminum' or 		
					player_input == 'unlock tungsten using aluminum key' or 				
					player_input == 'unlock tungsten using aluminum'):

					print("There isn't anything tungsten in here.")	

			if "aluminum key" not in inventory:

				if (player_input == 'use aluminum key on tungsten gate' or 
					player_input == 'use aluminum key on gate' or		
					player_input == 'use aluminum key on tungsten' or 						
					player_input == 'use aluminum key to open tungsten gate' or 
					player_input == 'use aluminum key to open gate' or 
					player_input == 'use aluminum key to open tungsten' or 		
					player_input == 'use aluminum key to unlock tungsten gate' or 
					player_input == 'use aluminum key to unlock gate' or
					player_input == 'use aluminum key to unlock tungsten' or 												 
					player_input == 'open tungsten gate with aluminum key' or 
					player_input == 'open gate with aluminum key' or 		
					player_input == 'open tungsten with aluminum key' or 									
					player_input == 'open tungsten gate using aluminum key' or 
					player_input == 'open gate using aluminum key' or 		
					player_input == 'open tungsten using aluminum key' or 					
					player_input == 'unlock tungsten gate with aluminum key' or 
					player_input == 'unlock gate with aluminum key' or 		
					player_input == 'unlock tungsten with aluminum key' or 									
					player_input == 'unlock tungsten gate using aluminum key' or 
					player_input == 'unlock gate using aluminum key' or 		
					player_input == 'unlock tungsten using aluminum key'):

					print("What aluminum key?")

				if (player_input == 'use aluminum on tungsten gate' or 
					player_input == 'use aluminum on gate' or		
					player_input == 'use aluminum on tungsten' or 						
					player_input == 'use aluminum to open tungsten gate' or 
					player_input == 'use aluminum to open gate' or 
					player_input == 'use aluminum to open tungsten' or 		
					player_input == 'use aluminum to unlock tungsten gate' or 
					player_input == 'use aluminum to unlock gate' or 
					player_input == 'use aluminum to unlock tungsten' or 												 
					player_input == 'open tungsten gate with aluminum' or 
					player_input == 'open gate with aluminum' or 		
					player_input == 'open tungsten with aluminum' or 									
					player_input == 'open tungsten gate using aluminum' or 
					player_input == 'open gate using aluminum' or 		
					player_input == 'open tungsten using aluminum' or 					
					player_input == 'unlock tungsten gate with aluminum' or 
					player_input == 'unlock gate with aluminum' or 		
					player_input == 'unlock tungsten with aluminum' or 									
					player_input == 'unlock tungsten gate using aluminum' or 
					player_input == 'unlock gate using aluminum' or 		
					player_input == 'unlock tungsten using aluminum'):

					print("What aluminum?")			

			return()	

		# UNLOCK TUNGSTEN GATE WITH BRASS KEY
		if (player_input == 'use brass key on tungsten gate' or 
			player_input == 'use brass key on gate' or		
			player_input == 'use brass key on tungsten' or 
			player_input == 'use brass on gate' or				
			player_input == 'use brass on tungsten' or 				
			player_input == 'use brass on tungsten gate' or 						
			player_input == 'use brass key to open tungsten gate' or 
			player_input == 'use brass key to open gate' or 
			player_input == 'use brass key to open tungsten' or 
			player_input == 'use brass to open gate' or			
			player_input == 'use brass to open tungsten' or
			player_input == 'use brass to open tungsten gate' or			
			player_input == 'use brass key to unlock tungsten gate' or 
			player_input == 'use brass key to unlock gate' or
			player_input == 'use brass key to unlock tungsten' or 	
			player_input == 'use brass to unlock gate' or			
			player_input == 'use brass to unlock tungsten' or		
			player_input == 'use brass to unlock tungsten gate' or													 
			player_input == 'open tungsten gate with brass key' or 
			player_input == 'open gate with brass key' or 		
			player_input == 'open tungsten with brass key' or 	
			player_input == 'open gate with brass' or				
			player_input == 'open tungsten with brass' or 	
			player_input == 'open tungsten gate with brass' or 								
			player_input == 'open tungsten gate using brass key' or 
			player_input == 'open gate using brass key' or 		
			player_input == 'open tungsten using brass key' or 	
			player_input == 'open gate using brass' or				
			player_input == 'open tungsten using brass' or 	
			player_input == 'open tungsten gate using brass' or 					
			player_input == 'unlock tungsten gate with brass key' or 
			player_input == 'unlock gate with brass key' or 		
			player_input == 'unlock tungsten with brass key' or 	
			player_input == 'unlock gate with brass' or				
			player_input == 'unlock tungsten with brass' or 	
			player_input == 'unlock tungsten gate with brass' or 								
			player_input == 'unlock tungsten gate using brass key' or 
			player_input == 'unlock gate using brass key' or 		
			player_input == 'unlock tungsten using brass key' or 	
			player_input == 'unlock gate using brass' or				
			player_input == 'unlock tungsten using brass' or 	
			player_input == 'unlock tungsten gate using brass'):

			if (game_states["roomid"] == 5 and 
				"brass key" in inventory):

				print("Brass key doesn't fit in the keyhole on the tungsten gate.")

			if game_states["roomid"] != 5:

				if (player_input == 'use brass key on gate' or		
					player_input == 'use brass on gate' or										
					player_input == 'use brass key to open gate' or 
					player_input == 'use brass to open gate' or			
					player_input == 'use brass key to unlock gate' or
					player_input == 'use brass to unlock gate' or			
					player_input == 'open gate with brass key' or 		
					player_input == 'open gate with brass' or				
					player_input == 'open gate using brass key' or 			
					player_input == 'open gate using brass' or				
					player_input == 'unlock gate with brass key' or 		
					player_input == 'unlock gate with brass' or				
					player_input == 'unlock gate using brass key' or 			
					player_input == 'unlock gate using brass'):

					print("There isn't any gate here.")

				if (player_input == 'use brass key on tungsten gate' or 		
					player_input == 'use brass on tungsten gate' or 						
					player_input == 'use brass key to open tungsten gate' or 
					player_input == 'use brass to open tungsten gate' or			
					player_input == 'use brass key to unlock tungsten gate' or 	
					player_input == 'use brass to unlock tungsten gate' or													 
					player_input == 'open tungsten gate with brass key' or 			
					player_input == 'open tungsten gate with brass' or 								
					player_input == 'open tungsten gate using brass key' or 		
					player_input == 'open tungsten gate using brass' or 					
					player_input == 'unlock tungsten gate with brass key' or 
					player_input == 'unlock tungsten gate with brass' or 								
					player_input == 'unlock tungsten gate using brass key' or 	
					player_input == 'unlock tungsten gate using brass'):

					print("There isn't any tungsten gate here.")

				if (player_input == 'use brass key on tungsten' or 		
					player_input == 'use brass on tungsten' or 				
					player_input == 'use brass key to open tungsten' or 		
					player_input == 'use brass to open tungsten' or
					player_input == 'use brass key to unlock tungsten' or 			
					player_input == 'open tungsten with brass key' or 				
					player_input == 'open tungsten with brass' or 			
					player_input == 'open tungsten using brass key' or 				
					player_input == 'open tungsten using brass' or 		
					player_input == 'unlock tungsten with brass key' or 				
					player_input == 'unlock tungsten with brass' or 		
					player_input == 'unlock tungsten using brass key' or 				
					player_input == 'unlock tungsten using brass'):

					print("There isn't anything tungsten in here.")

			if "brass key" not in inventory:

				if (player_input == 'use brass key on tungsten gate' or 
					player_input == 'use brass key on gate' or		
					player_input == 'use brass key on tungsten' or 						
					player_input == 'use brass key to open tungsten gate' or 
					player_input == 'use brass key to open gate' or 
					player_input == 'use brass key to open tungsten' or 		
					player_input == 'use brass key to unlock tungsten gate' or 
					player_input == 'use brass key to unlock gate' or						
					player_input == 'use brass key to unlock tungsten' or 												 
					player_input == 'open tungsten gate with brass key' or 
					player_input == 'open gate with brass key' or 		
					player_input == 'open tungsten with brass key' or 									
					player_input == 'open tungsten gate using brass key' or 
					player_input == 'open gate using brass key' or 		
					player_input == 'open tungsten using brass key' or 					
					player_input == 'unlock tungsten gate with brass key' or 
					player_input == 'unlock gate with brass key' or 		
					player_input == 'unlock tungsten with brass key' or 									
					player_input == 'unlock tungsten gate using brass key' or 
					player_input == 'unlock gate using brass key' or 		
					player_input == 'unlock tungsten using brass key'):

					print("What brass key?")

				if (player_input == 'use brass on tungsten gate' or 
					player_input == 'use brass on gate' or		
					player_input == 'use brass on tungsten' or 						
					player_input == 'use brass to open tungsten gate' or 
					player_input == 'use brass to open gate' or 
					player_input == 'use brass to open tungsten' or 		
					player_input == 'use brass to unlock tungsten gate' or 
					player_input == 'use brass to unlock gate' or
					player_input == 'use brass to unlock tungsten' or 												 
					player_input == 'open tungsten gate with brass' or 
					player_input == 'open gate with brass' or 		
					player_input == 'open tungsten with brass' or 									
					player_input == 'open tungsten gate using brass' or 
					player_input == 'open gate using brass' or 		
					player_input == 'open tungsten using brass' or 					
					player_input == 'unlock tungsten gate with brass' or 
					player_input == 'unlock gate with brass' or 		
					player_input == 'unlock tungsten with brass' or 									
					player_input == 'unlock tungsten gate using brass' or 
					player_input == 'unlock gate using brass' or 		
					player_input == 'unlock tungsten using brass'):

					print("What brass?")

			return()

		# UNLOCK TUNGSTEN GATE WITH IRON KEY
		if (player_input == 'use iron key on tungsten gate' or 
			player_input == 'use iron key on gate' or		
			player_input == 'use iron key on tungsten' or 
			player_input == 'use iron on gate' or				
			player_input == 'use iron on tungsten' or 				
			player_input == 'use iron on tungsten gate' or 						
			player_input == 'use iron key to open tungsten gate' or 
			player_input == 'use iron key to open gate' or 
			player_input == 'use iron key to open tungsten' or 
			player_input == 'use iron to open gate' or			
			player_input == 'use iron to open tungsten' or
			player_input == 'use iron to open tungsten gate' or			
			player_input == 'use iron key to unlock tungsten gate' or 
			player_input == 'use iron key to unlock gate' or
			player_input == 'use iron key to unlock tungsten' or 	
			player_input == 'use iron to unlock gate' or			
			player_input == 'use iron to unlock tungsten' or		
			player_input == 'use iron to unlock tungsten gate' or													 
			player_input == 'open tungsten gate with iron key' or 
			player_input == 'open gate with iron key' or 		
			player_input == 'open tungsten with iron key' or 	
			player_input == 'open gate with iron' or				
			player_input == 'open tungsten with iron' or 	
			player_input == 'open tungsten gate with iron' or 								
			player_input == 'open tungsten gate using iron key' or 
			player_input == 'open gate using iron key' or 		
			player_input == 'open tungsten using iron key' or 	
			player_input == 'open gate using iron' or				
			player_input == 'open tungsten using iron' or 	
			player_input == 'open tungsten gate using iron' or 					
			player_input == 'unlock tungsten gate with iron key' or 
			player_input == 'unlock gate with iron key' or 		
			player_input == 'unlock tungsten with iron key' or 	
			player_input == 'unlock gate with iron' or				
			player_input == 'unlock tungsten with iron' or 	
			player_input == 'unlock tungsten gate with iron' or 								
			player_input == 'unlock tungsten gate using iron key' or 
			player_input == 'unlock gate using iron key' or 		
			player_input == 'unlock tungsten using iron key' or 	
			player_input == 'unlock gate using iron' or				
			player_input == 'unlock tungsten using iron' or 	
			player_input == 'unlock tungsten gate using iron'):	

			if (game_states["roomid"] == 5 and "iron key" in inventory):

				if game_states["tungstengate"] != 0:

					print("The tungsten gate is already unlocked.")

				if game_states["tungstengate"] == 0:

					print("You've successfully unlocked the tungsten gate.")
					game_states["tungstengate"] = 1

			if game_states["roomid"] != 5:

				if (player_input == 'use iron key on gate' or		
					player_input == 'use iron on gate' or										
					player_input == 'use iron key to open gate' or 
					player_input == 'use iron to open gate' or			
					player_input == 'use iron key to unlock gate' or
					player_input == 'use iron to unlock gate' or			
					player_input == 'open gate with iron key' or 		
					player_input == 'open gate with iron' or				
					player_input == 'open gate using iron key' or 			
					player_input == 'open gate using iron' or				
					player_input == 'unlock gate with iron key' or 		
					player_input == 'unlock gate with iron' or				
					player_input == 'unlock gate using iron key' or 			
					player_input == 'unlock gate using iron'):	

					print("There isn't any gate here.")

				if (player_input == 'use iron key on tungsten gate' or 		
					player_input == 'use iron on tungsten gate' or 						
					player_input == 'use iron key to open tungsten gate' or 
					player_input == 'use iron to open tungsten gate' or			
					player_input == 'use iron key to unlock tungsten gate' or 	
					player_input == 'use iron to unlock tungsten gate' or													 
					player_input == 'open tungsten gate with iron key' or 			
					player_input == 'open tungsten gate with iron' or 								
					player_input == 'open tungsten gate using iron key' or 		
					player_input == 'open tungsten gate using iron' or 					
					player_input == 'unlock tungsten gate with iron key' or 
					player_input == 'unlock tungsten gate with iron' or 								
					player_input == 'unlock tungsten gate using iron key' or 	
					player_input == 'unlock tungsten gate using iron'):

					print("There isn't any tungsten gate here.")

				if (player_input == 'use iron key on tungsten' or 		
					player_input == 'use iron on tungsten' or 				
					player_input == 'use iron key to open tungsten' or 		
					player_input == 'use iron to open tungsten' or
					player_input == 'use iron key to unlock tungsten' or 			
					player_input == 'open tungsten with iron key' or 				
					player_input == 'open tungsten with iron' or 			
					player_input == 'open tungsten using iron key' or 				
					player_input == 'open tungsten using iron' or 		
					player_input == 'unlock tungsten with iron key' or 				
					player_input == 'unlock tungsten with iron' or 		
					player_input == 'unlock tungsten using iron key' or 				
					player_input == 'unlock tungsten using iron'):

					print("There isn't anything tungsten in here.")			

			if "iron key" not in inventory:

				if (player_input == 'use iron key on tungsten gate' or 
					player_input == 'use iron key on gate' or		
					player_input == 'use iron key on tungsten' or 						
					player_input == 'use iron key to open tungsten gate' or 
					player_input == 'use iron key to open gate' or 
					player_input == 'use iron key to open tungsten' or 		
					player_input == 'use iron key to unlock tungsten gate' or 
					player_input == 'use iron key to unlock gate' or
					player_input == 'use iron key to unlock tungsten' or 												 
					player_input == 'open tungsten gate with iron key' or 
					player_input == 'open gate with iron key' or 		
					player_input == 'open tungsten with iron key' or 									
					player_input == 'open tungsten gate using iron key' or 
					player_input == 'open gate using iron key' or 		
					player_input == 'open tungsten using iron key' or 					
					player_input == 'unlock tungsten gate with iron key' or 
					player_input == 'unlock gate with iron key' or 		
					player_input == 'unlock tungsten with iron key' or 									
					player_input == 'unlock tungsten gate using iron key' or 
					player_input == 'unlock gate using iron key' or 		
					player_input == 'unlock tungsten using iron key'):

					print("What iron key?")

				if (player_input == 'use iron on tungsten gate' or 
					player_input == 'use iron on gate' or		
					player_input == 'use iron on tungsten' or 						
					player_input == 'use iron to open tungsten gate' or 
					player_input == 'use iron to open gate' or 
					player_input == 'use iron to open tungsten' or 		
					player_input == 'use iron to unlock tungsten gate' or 
					player_input == 'use iron to unlock gate' or
					player_input == 'use iron to unlock tungsten' or 												 
					player_input == 'open tungsten gate with iron' or 
					player_input == 'open gate with iron' or 		
					player_input == 'open tungsten with iron' or 									
					player_input == 'open tungsten gate using iron' or 
					player_input == 'open gate using iron' or 		
					player_input == 'open tungsten using iron' or 					
					player_input == 'unlock tungsten gate with iron' or 
					player_input == 'unlock gate with iron' or 		
					player_input == 'unlock tungsten with iron' or 									
					player_input == 'unlock tungsten gate using iron' or 
					player_input == 'unlock gate using iron' or 		
					player_input == 'unlock tungsten using iron'):

					print("What iron?")	

			return()

		# OPEN TUNGSTEN GATE
		if (player_input == 'open tungsten gate' or 
			player_input == 'open gate' or
			player_input == 'open tungsten'):

			if game_states["roomid"] == 5:

				if game_states["tungstengate"] == 0:

					print("The tungsten gate is locked.")
					print("There is a keyhole on the gate.")
					print("You will need to unlock the gate with a key.")

				if game_states["tungstengate"] != 0:

					game_states["escaped"] = 1
					end()

			if game_states["roomid"] != 5:

				if player_input == 'open tungsten gate':
					print("There isn't any tungsten gate here.")

				if player_input == 'open tungsten':
					print("There isn't anything tungsten in here.")

				if player_input == 'open gate':
					print("There isn't any gate here.")	

			return()

		# CLOSE TUNGSTEN GATE / LOCK TUNGSTEN GATE
		if (player_input == 'close gate' or 
			player_input == 'close tungsten gate' or
			player_input == 'close tungsten' or
			player_input == 'lock gate' or
			player_input == 'lock tungsten gate' or
			player_input == 'lock tungsten'):

			if game_states["roomid"] == 5:

				if game_states["tungstengate"] == 0:

					print("The tungsten gate is already closed and locked.")

				if game_states["tungstengate"] != 0:

					print("You lock the tungsten gate.")
					game_states["tungstengate"] = 0			

			if game_states["roomid"] != 5:

				if (player_input == 'close tungsten gate' or
					player_input == 'lock tungsten gate'):

					print("There isn't any tungsten gate here.")	

				if (player_input == 'close tungsten' or
					player_input == 'lock tungsten'):

					print("There isn't anything tungsten in here.")	

				if (player_input == 'close gate' or 
					player_input == 'lock gate'):

					print("There isn't any gate here.")	

			return()

		# TAKE TUNGSTEN GATE
		if (player_input == 'take gate' or 
			player_input == 'take tungsten gate' or
			player_input == 'take tungsten'):

			if game_states["roomid"] == 5:

				print("It is impossible to lift the tungsten gate off its hinge.")

			if game_states["roomid"] != 5:

				if (player_input == 'take tungsten gate'):
					print("There isn't any tungsten gate here.")	

				if (player_input == 'take tungsten'):
					print("There isn't anything tungsten in here.")	

				if (player_input == 'take gate'):
					print("There isn't any gate here.")	

			return()

		# LOOK PASSAGE
		if player_input == 'look passage':

			if game_states["roomid"] == 5:
				print("Peering through the tungsten gate and squinting to see beyond "
				  "the passage, \nyou can see blue sky and grassy meadows.")

			if game_states["roomid"] != 5:
				print("What passage?")

			return()

		# LOOK WALL
		if (player_input == 'look wall' or
			player_input == 'look walls'):
			print("The walls are made of metal.")
			return()

		# TAKE WALL
		if (player_input == 'take wall' or
			player_input == 'take walls'):
			print("As much as you try to, you can't take down the wall.")
			return()

		# LOOK FLOOR
		if player_input == 'look floor':
			print("The floor is made of metal.")
			return()

		# TAKE FLOOR
		if player_input == 'take floor':
			print("As much as you try to, you can't tear up the floor.")
			return()

		# LOOK CEILING
		if player_input == 'look ceiling':
			print("The ceiling is made of metal.")
			return()

		# TAKE CEILING
		if player_input == 'take ceiling':
			print("You can't quite reach the ceiling despite jumping as high as you can.")
			return()
		
		# LOOK DOOR
		if (player_input == 'look door' or
			player_input == 'look doors'):

			if game_states["roomid"] == 1:
				print("The doors are made of metal and opens automatically when you approach them.")
				print("None of the doors has window on them.")

			if game_states["roomid"] != 1:
				print("The door is made of metal and opens automatically when you approach them.")
				print("There isn't any window on the door.")

			return()

		# TAKE DOOR
		if (player_input == 'take door' or
			player_input == 'take doors'):
			print("After numerous attempts, you have came to conclusion that you can't tear the door out of its frame.")
			return()

		# LOOK DOOR LIGHT / LOOK LIGHT ABOVE DOOR
		if (player_input == 'look door light' or 
			player_input == 'look doors light' or 
			player_input == 'look door lights' or 
			player_input == 'look doors lights' or 			
			player_input == 'look light above door' or
			player_input == 'look lights above door' or
			player_input == 'look light above doors' or
			player_input == 'look lights above doors'):

			print("The light is an indicator of the status of the door.")
			print("Red is locked and green is unlocked.")

			if game_states["roomid"] == 1:

				if game_states["northdoor"] == 0:
						print("The light above the door in the north is red.")

				if game_states["northdoor"] != 0:
						print("The light above the door in the north is green.")

				if game_states["southdoor"] == 0:
						print("The light above the door in the south is red.")

				if game_states["southdoor"] != 0:
						print("The light above the door in the south is green.")

				if game_states["eastdoor"] == 0:
						print("The light above the door in the east is red.")

				if game_states["eastdoor"] != 0:
						print("The light above the door in the east is green.")	

				if game_states["westdoor"] == 0:
						print("The light above the door in the west is red.")

				if game_states["westdoor"] != 0:
						print("The light above the door in the west is green.")	

			if game_states["roomid"] == 2:

				if game_states["eastdoor"] == 0:
						print("The light above the door in the west is red.")

				if game_states["eastdoor"] != 0:
						print("The light above the door in the west is green.")

			if game_states["roomid"] == 3:

				if game_states["westdoor"] == 0:
						print("The light above the door in the east is red.")

				if game_states["westdoor"] != 0:
						print("The light above the door in the east is green.")

			if game_states["roomid"] == 4:

				if game_states["southdoor"] == 0:
						print("The light above the door in the north is red.")

				if game_states["southdoor"] != 0:
						print("The light above the door in the north is green.")

			if game_states["roomid"] == 5:

				if game_states["northdoor"] == 0:
						print("The light above the door in the south is red.")

				if game_states["northdoor"] != 0:
						print("The light above the door in the south is green.")

			return()

		# TAKE DOOR LIGHT
		if (player_input == 'take door light' or
			player_input == 'take doors light' or 
			player_input == 'take doors lights' or 
			player_input == 'take door lights'):
			print("After many attempts, you've given up.  It's impossible to dislodge the light above the door.")
			return()	

		# LOOK LIGHT
		if (player_input == 'look light' or 
			player_input == 'look lights'):

			if game_states["roomid"] != 3:
				print("There is a light source on the ceiling.")
				print("It looks like a very bright LED embedded in the ceiling.")

			print("The light above the door is an indicator of the status of the door.")
			print("Red is locked and green is unlocked.")

			if game_states["roomid"] == 1:

				if game_states["northdoor"] == 0:
						print("The light above the door in the north is red.")

				if game_states["northdoor"] != 0:
						print("The light above the door in the north is green.")	

				if game_states["southdoor"] == 0:
						print("The light above the door in the south is red.")

				if game_states["southdoor"] != 0:
						print("The light above the door in the south is green.")

				if game_states["eastdoor"] == 0:
						print("The light above the door in the east is red.")

				if game_states["eastdoor"] != 0:
						print("The light above the door in the east is green.")	

				if game_states["westdoor"] == 0:
						print("The light above the door in the west is red.")

				if game_states["westdoor"] != 0:
						print("The light above the door in the west is green.")	

			if game_states["roomid"] == 2:

				if game_states["eastdoor"] == 0:
						print("The light above the door in the west is red.")

				if game_states["eastdoor"] != 0:
						print("The light above the door in the west is green.")	

			if game_states["roomid"] == 3:

				if game_states["westdoor"] == 0:
						print("The light above the door in the east is red.")

				if game_states["westdoor"] != 0:
						print("The light above the door in the east is green.")	

			if game_states["roomid"] == 4:

				if game_states["southdoor"] == 0:
						print("The light above the door in the north is red.")

				if game_states["southdoor"] != 0:
						print("The light above the door in the north is green.")

			if game_states["roomid"] == 5:

				if game_states["northdoor"] == 0:
						print("The light above the door in the south is red.")

				if game_states["northdoor"] != 0:
						print("The light above the door in the south is green.")

			if game_states["flashlight"] != 0:
				print("Light is shining from the flashlight.")

			return()

		# TAKE LIGHT
		if (player_input == 'take light' or 
			player_input == 'take lights'):

			if game_states["roomid"] != 3:
				print("You can't quite reach the light on the ceiling despite repeatedly jumping as high as you can.")

			if game_states["roomid"] == 3:
				print("There is no light in here, other than the dim light above the door in the east.")

			return()

		# LOOK PAPER
		if player_input == 'look paper':

			if "paper" in inventory:
				print("It's a piece of paper filled with strange scribbles.")
				print("You can't understand the scribbles.")

			if "paper" not in inventory:
				if game_states["roomid"] != 2:
					print("What paper?")

				if game_states["roomid"] == 2:
					print("It's a piece of paper, you can see scribbles on it.")
					print("It's currently laying on the floor.")					

			return()	

		# TAKE PAPER
		if player_input == 'take paper':

			if "paper" in inventory:
				print("You already took the paper.")

			if "paper" not in inventory:
				if game_states["roomid"] != 2:
					print("What paper?")

				if game_states["roomid"] == 2:
					print("Taken.")
					print("The paper was covering a yellow switch.")
					inventory.append("paper")

			return()

		# LOOK FLASHLIGHT
		if player_input == 'look flashlight':

			if "flashlight" not in inventory:
				print("What flashlight?")

			if "flashlight" in inventory:
				if game_states["flashlightbatteries"] == 0:
					print("It's a simple flashlight.  It needs some batteries, though.")

				if game_states["flashlightbatteries"] != 0:

					if game_states["flashlight"] == 0:
						print("It's a simple flashlight.  It is currently off.")

					if game_states["flashlight"] != 0:
						print("It's a simple flashlight.  It is currently on and illuminating the area.")

			return()

		# TAKE FLASHLIGHT
		if player_input == 'take flashlight':

			if "flashlight" not in inventory:
				print("What flashlight?")

			if "flashlight" in inventory:
				print("You already took the flashlight.")

			return()

		# LOOK BATTERIES
		if (player_input == 'look batteries' or
			player_input == 'look battery'):

			if "batteries" in inventory:
				print("They're D cell batteries.")						

			if (game_states["roomid"] == 5 and 
				"batteries" not in inventory and
				game_states["steelbox"] != 0):
				print("They're D cell batteries.  The batteries are currently inside the steel box.")					

			if "batteries" not in inventory:
				if player_input == 'look batteries':
					print("What batteries?")

				if player_input == 'look battery':
					print("What battery?")			

			return()			

		# TAKE BATTERIES
		if (player_input == 'take batteries' or
			player_input == 'take battery'):

			if "batteries" in inventory:
				print("You already took the batteries.")	

			if (game_states["roomid"] == 5 and 
				"batteries" not in inventory and
				game_states["steelbox"] != 0):
				print("Taken.")
				inventory.append("batteries")

			if "batteries" not in inventory:
				if player_input == 'take batteries':
					print("What batteries?")

				if player_input == 'take battery':
					print("What battery?")	

			return()	

		# INSERT BATTERIES INTO FLASHLIGHT
		if (player_input == 'put batteries in flashlight' or
			player_input == 'put batteries into flashlight' or
			player_input == 'put battery in flashlight' or	
			player_input == 'put battery into flashlight' or				
			player_input == 'insert batteries in flashlight' or
			player_input == 'insert batteries into flashlight' or
			player_input == 'insert battery in flashlight' or					
			player_input == 'insert battery into flashlight'):

			if "flashlight" in inventory:

				if "batteries" in inventory:

					if game_states["flashlightbatteries"] != 0:
						print("Batteries are already inside the flashlight.")

					if game_states["flashlightbatteries"] == 0:
						print("Batteries are now inside the flashlight.")
						game_states["flashlightbatteries"] = 1

				if "batteries" not in inventory:
					print("You don't have any batteries.")

			if "flashlight" not in inventory:
				print("What flashlight?")

			if "batteries" not in inventory:

					if (player_input == 'put batteries in flashlight' or
						player_input == 'put batteries into flashlight' or 
						player_input == 'insert batteries in flashlight' or 
						player_input == 'insert batteries into flashlight'):
						print("What batteries?")

					if (player_input == 'put battery in flashlight' or
						player_input == 'put battery into flashlight' or
						player_input == 'insert battery in flashlight' or
						player_input == 'insert battery into flashlight'):
						print("What battery?")

			return()

		# TURN FLASHLIGHT ON
		if (player_input == 'turn flashlight on' or
			player_input == 'turn on flashlight' or
			player_input == 'turn on light' or
			player_input == 'turn light on'):

			if "flashlight" in inventory:

				if game_states["flashlightbatteries"] != 0:

					if game_states["flashlight"] != 0:
						print("The flashlight is already turned on.")			

					if game_states["flashlight"] == 0:
						print("You turn the flashlight on.  Light is shining from it.")
						game_states["flashlight"] = 1

				if game_states["flashlightbatteries"] == 0:
					print("Flashlight won't turn on.  There are no batteries inside it.")

			if "flashlight" not in inventory:
				print("What flashlight?")

			return()

		# TURN FLASHLIGHT OFF
		if (player_input == 'turn flashlight off' or
			player_input == 'turn off flashlight' or
			player_input == 'turn off light' or
			player_input == 'turn light off'):		

			if "flashlight" in inventory:		

				if game_states["flashlight"] == 0:
					print("The flashlight is already off.")

				if game_states["flashlight"] != 0:

					game_states["flashlight"] = 0

					if game_states["roomid"] != 3:
						print("You turn the flashlight off.")					

					if game_states["roomid"] == 3:
						westroom()

			if "flashlight" not in inventory:
				print("What flashlight?")

			return()

		# LOOK ALUMINUM KEY
		if (player_input == 'look aluminum key' or 
			player_input == 'look aluminum'):

			if "aluminum key" in inventory:
				print("It's a lightweight key made out of aluminum.")

			if game_states["roomid"] == 2:
				if ("aluminum key" not in inventory and 
				game_states["bronzebox"] == 2):
					print("It's a lightweight key made out of aluminum.")
					print("The aluminum key is currently sitting inside the bronze box.")

				if ("aluminum key" not in inventory and 
				game_states["bronzebox"] != 2):
					if player_input == 'look aluminum key':
						print("You don't see any aluminum key in here.")

					if player_input == 'look aluminum':
						print("You don't see anything aluminum in here.")

			if (game_states["roomid"] == 2 and
				"aluminum key" not in inventory):

				if player_input == 'look aluminum key':
					print("You don't see any aluminum key in here.")

				if player_input == 'look aluminum':
					print("You don't see anything aluminum in here.")

			return()

		# TAKE ALUMINUM KEY
		if (player_input == 'take aluminum key' or
			player_input == 'take aluminum'):

			if "aluminum key" in inventory:
				print("You already took the aluminum key.")

			if game_states["roomid"] == 2:

				if ("aluminum key" not in inventory and 
				game_states["bronzebox"] == 2):
					print("Taken.")
					inventory.append("aluminum key")

				if ("aluminum key" not in inventory and 
				game_states["bronzebox"] != 2):
					if player_input == 'take aluminum key':
						print("You don't see any aluminum key in here.")

					if player_input == 'take aluminum':
						print("You don't see anything aluminum in here.")

			if (game_states["roomid"] != 2 and 
				"aluminun key" not in inventory):

				if player_input == 'take aluminum key':
					print("You don't see any aluminum key in here.")

				if player_input == 'take aluminum':
					print("You don't see anything aluminum in here.")

			return()

		# USE ALUMINUM KEY
		if (player_input == 'use aluminum key' or 
			player_input == 'use aluminum'):

			if "aluminum key" in inventory:
				print("Please specify which lock to unlock using aluminum key.")

			if (game_states["roomid"] == 2 and
				"aluminum key" not in inventory and 
				game_states["bronzebox"] == 2):
				print("You need to take the aluminum key first.")

			else:
				if player_input == 'use aluminum key':
					print("What aluminum key?")

				if player_input == 'use aluminum':
					print("What aluminum?")

			return()

		# LOOK BRASS KEY / LOOK BRASS
		if (player_input == 'look brass key' or 
			player_input == 'look brass'):

			if "brass key" in inventory:
				print("It's a key made of burnished brass.")

			if game_states["roomid"] == 4:
				if ("brass key" not in inventory and
					game_states["planter"] != 0):
					print("It's a key made of burnished brass.")
					print("Brass key is currently partially buried in a pile of dirt.")

				if ("brass key" not in inventory and
					game_states["planter"] == 0):
					if player_input == 'look brass key':
						print("You don't see any brass key in here.")

					if player_input == 'look brass':
						print("You don't see anything brass in here.")

			if (game_states["roomid"] != 4 and
				"brass key" not in inventory):

				if player_input == 'look brass key':
					print("You don't see any brass key in here.")

				if player_input == 'look brass':
					print("You don't see anything brass in here.")

			return()		

		# TAKE BRASS KEY
		if (player_input == 'take brass key' or 
			player_input == 'take brass'):

			if "brass key" in inventory:
				print("You already took the brass key.")

			if game_states["roomid"] == 4:

				if ("brass key" not in inventory and 
					game_states["planter"] != 0):
					print("Taken.")
					inventory.append("brass key")

				if ("brass key" not in inventory and 
					game_states["planter"] == 0):
					if player_input == 'take brass key':
						print("You don't see any brass key in here.")

					if player_input == 'take brass':
						print("You don't see anything brass in here.")

			if (game_states["roomid"] != 4 and
				"brass key" not in inventory):

				if player_input == 'take brass key':
					print("You don't see any brass key in here.")

				if player_input == 'take brass':
					print("You don't see anything brass in here.")

			return()

		# USE BRASS KEY
		if (player_input == 'use brass key' or 
			player_input == 'use brass'):

			if "brass key" in inventory:
				print("Please specify which lock to unlock using brass key.")

			if (game_states["roomid"] == 4 and
				game_states["planter"] != 0	and			
				"brass key" not in inventory):
				print("You need to take the brass key first.")

			else:

				if player_input == 'use brass key':
					print("\nWhat brass key?")

				if player_input == 'use brass':
					print("\nWhat brass?")

			return()	

		# LOOK IRON KEY / LOOK IRON
		if (player_input == 'look iron key' or 
			player_input == 'look iron'):

			if "iron key" in inventory:
				print("It's a heavy key made out of iron.")

			if game_states["roomid"] == 3:

				if ("iron key" not in inventory and
					game_states["titaniumbox"] != 0):
					print("It's a heavy key made out of iron.")
					print("Iron key is currently inside the titanium box.")

				if ("iron key" not in inventory and
					game_states["titaniumbox"] == 0):

					if player_input == 'look iron key':
						print("You don't see any iron key in here.")

					if player_input == 'look iron':
						print("You don't see anything iron in here.")

			if (game_states["roomid"] != 3 and 
				"iron key" not in inventory):

				if player_input == 'look iron key':
					print("You don't see any iron key in here.")

				if player_input == 'look iron':
					print("You don't see anything iron in here.")

			return()

		# TAKE IRON KEY #
		if (player_input == 'take iron key' or 
			player_input == 'take iron'):

			if "iron key" in inventory:
				print("You already took the iron key.")

			if game_states["roomid"] == 3:
				if ("iron key" not in inventory and
					game_states["titaniumbox"] != 0):

					print("Taken.")
					inventory.append("iron key")

				if ("iron key" not in inventory and
					game_states["titaniumbox"] == 0):

					if player_input == 'take iron key':
						print("You don't see any iron key in here.")

					if player_input == 'take iron':
						print("You don't see anything iron in here.")

			if (game_states["roomid"] != 3 and
				"iron key" not in inventory):

				if player_input == 'take iron key':
					print("You don't see any iron key in here.")

				if player_input == 'take iron':
					print("You don't see anything iron in here.")

			return()

		# USE IRON KEY #
		if (player_input == 'use iron key' or 
			player_input == 'use iron'):

			if "iron key" in inventory:
				print("Please specify which lock to unlock using iron key.")

			if (game_states["roomid"] == 3 and
				"iron key" not in inventory and 
				game_states["titaniumbox"] != 0):
				print("You need to take the iron key first.")

			else:

				if player_input == 'use iron key':
					print("What iron key?")

				if player_input == 'use iron':
					print("What iron?")

			return()			

		# LOOK KEY #
		if player_input == 'look key':

			if (game_states["roomid"] == 1 or
				game_states["roomid"] == 5):

				if ("iron key" in inventory or
					"brass key" in inventory or
					"aluminum key" in inventory):

					print("Please specify which key to look at.")

				if ("iron key" not in inventory or
					"brass key" not in inventory or
					"aluminum key" not in inventory):

					print("What key?")							

			if game_states["roomid"] == 2:

				if ("aluminum key" not in inventory and 
					game_states["bronzebox"] == 2):

					if ("iron key" not in inventory and
						"brass key" not in inventory):

						print("It's a lightweight key made out of aluminum.")
						print("Aluminum key is currently sitting inside the bronze box.")

					if ("iron key" in inventory or
						"brass key" in inventory):

						print("Please specify which key to look at.")		

				if ("aluminum key" not in inventory and 
					game_states["bronzebox"] != 2):

					if ("iron key" in inventory or
						"brass key" in inventory):

						print("Please specify which key to look at.")

					if ("iron key" not in inventory and
						"brass key" not in inventory):

						print("What key?")

			if game_states["roomid"] == 3:

				if ("iron key" not in inventory and 
					game_states["titaniumbox"] != 0):

					if ("aluminum key" not in inventory and 
						"brass key" not in inventory):

						print("It's a very heavy key made of iron.")
						print("Iron key is currently sitting inside the titanium box.")

					if ("aluminum key" in inventory and 
						"brass key" in inventory):

						print("Please specify which key to look at.")

				if ("iron key" not in inventory and
					game_states["titaniumbox"] == 0):

					if ("aluminum key" in inventory and 
						"brass key" in inventory):

						print("Please specify which key to look at.")

					if ("aluminum key" not in inventory and 
						"brass key" not in inventory):

						print("What key?")	

			if game_states["roomid"] == 4:

				if (game_states["planter"] != 0 and
					"brass key" not in inventory):

					if ("aluminum key" not in inventory and 
						"iron key" not in inventory):

						print("It's a key made of burnished brass.")
						print("Brass key is currently partially buried in a pile of dirt.")

					if ("aluminum key" in inventory or 
						"iron key" in inventory):

						print("Please specify which key to look at.")						

				if (game_states["planter"] == 0 and
					"brass key" not in inventory):

					if ("aluminum key" in inventory or 
						"iron key" in inventory):

						print("Please specify which key to look at.")

					if ("aluminum key" not in inventory and 
						"iron key" not in inventory):

						print("What key?")

				# THIS CONDITION ONLY EXISTS IN DEBUG MODE!
				if (game_states["planter"] == 0 and
					"brass key" in inventory):

					if ("aluminum key" not in inventory and 
						"iron key" not in inventory):

						print("*DEBUG* It's a key made of burnished brass.")
						print("*DEBUG* Brass key is currently partially buried in a pile of dirt.")

					if ("aluminum key" not in inventory and 
						"iron key" not in inventory):

						print("*DEBUG* Please specify which key to look at.")						

			return()	

		# TAKE KEY
		if player_input == 'take key':

			if (game_states["roomid"] == 1 or
				game_states["roomid"] == 5):

				print("You don't see any key here.")

			if game_states["roomid"] == 2:

				if "aluminum key" in inventory:
					print("You already took the aluminum key.")	

				if ("aluminum key" not in inventory and
					game_states["bronzebox"] == 2):

					print("Taken.")
					inventory.append("aluminum key")

				if ("aluminum key" not in inventory and
					game_states["bronzebox"] != 2):

					print("\nYou don't see any key here.")

			if game_states["roomid"] == 3:

				if "iron key" in inventory:
					print("You already took the iron key.")	

				if ("iron key" not in inventory and
					game_states["titaniumbox"] != 0):

					print("Taken.")
					inventory.append("iron key")

				if ("iron key" not in inventory and
					game_states["titaniumbox"] == 0):

					print("You don't see any key here.")

			if game_states["roomid"] == 4:

				if (game_states["planter"] != 0 and
					"brass key" in inventory):

					print("You already took the brass key.")		

				if (game_states["planter"] == 0 and
					"brass key" in inventory):

					# THIS CONDITION EXISTS ONLY IN DEBUG MODE.
					print("*DEBUG* You already took the brass key.")

				if (game_states["planter"] != 0 and
					"brass key" not in inventory):

					print("Taken.")
					inventory.append("brass key")

				if (game_states["planter"] == 0 and
					"brass key" not in inventory):

					print("You don't see any key here.")

			return()

		# USE KEY
		if player_input == 'use key':

			if ("iron key" in inventory or
				"brass key" in inventory or
				"aluminum key" in inventory):

				print("Please specify the key to use and the lock to unlock using the key.")

			if ("iron key" not in inventory or
				"brass key" not in inventory or
				"aluminum key" not in inventory):

				print("What key?")

			return()

		# LOOK SWITCH
		if (player_input == 'look switch' or 
			player_input == 'look switches'):

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 3 or 
				(game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 0) or
				(game_states["roomid"] == 5 and
				game_states["northaccesspanel"] == 0)):

				print("You don't see any switch here.")

			if game_states["roomid"]== 2:
				print("Green switch on the wall is a small push button switch the size of a coin.")

				if "paper" in inventory:
					print("Yellow switch on the floor is a small oval switch.")

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):

				print("There is a red switch and a blue switch inside the metal access panel.")
				print("Both red and blue switches are square push button switch the size of a coin.")
			
			if (game_states["roomid"] == 5 and
				game_states["northaccesspanel"] != 0):

				print("There is a white switch and a black switch inside the metal access panel.")
				print("Both black and white switches are round push button switch the size of a coin.")

			return()

		# TAKE SWITCH
		if (player_input == 'take switch' or 
			player_input == 'take switches'):

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 3 or 
				(game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 0) or
				(game_states["roomid"] == 5 and
				game_states["northaccesspanel"] == 0)):

				print("You don't see any switch here.")				

			if game_states["roomid"] == 2:
				print("Green switch is securely affixed to the wall. You can't take it.")

				if "paper" in inventory:
					print("Yellow switch is securely affixed to the floor. You can't take it.")

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):

				print("Blue switch is securely affixed to inside of the panel. You can't take it.")
				print("Red switch is securely affixed to inside of the panel. You can't take it.")
			
			if (game_states["roomid"] == 5 and
				game_states["northaccesspanel"] != 0):

				print("Black switch is securely affixed to inside of the panel. You can't take it.")
				print("White switch is securely affixed to inside of the panel. You can't take it.")

			return()

		# PRESS SWITCH
		if (player_input == 'press switch' or 
			player_input == 'push switch'):

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 3):

				print("You don't see any switch here.")		

			if (game_states["roomid"] == 2):

				if ("paper" in inventory):

					print("You press the green switch.")

					if (game_states["northdoor"] == 0 and 
						game_states["bronzebox"] != 2):

						game_states["northdoor"] = 1
						return()

					if (game_states["northdoor"] != 0 and 
						game_states["bronzebox"] != 2):

						game_states["northdoor"] = 0
						return()

					if (game_states["northdoor"] != 0 and 
						game_states["bronzebox"] == 2):

						game_states["northdoor"] = 0
						return()

					if (game_states["northdoor"] == 0 and 
						game_states["bronzebox"] == 2):

						game_states["northdoor"] = 0
						return()

				if ("paper" in inventory):
					print("Please specify which switch to press.")

			if (game_states["roomid"] == 4):

				if (game_states["southaccesspanel"] != 2):
					print("You don't see any switch here.")

				if (game_states["southaccesspanel"] == 2):
					print("Please specify which switch to press.")

			if (game_states["roomid"] == 5):

				if (game_states["northaccesspanel"] == 0):
					print("You don't see any switch here.")

				if (game_states["northaccesspanel"] != 0):
					print("Please specify which switch to press.")

			return()	

		# LOOK RED SWITCH
		if (player_input == 'look red switch' or 
			player_input == 'look red'):

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):	

				print("Red switch inside the access panel is a square push button switch the size of a coin.")

			else:

				if (player_input == 'look red switch'):
					print("You don't see any red switch here.")

				if (player_input == 'look red'):
					print("You don't see anything red in here.")

			return()

		# TAKE RED SWITCH
		if (player_input == 'take red switch' or 
			player_input == 'take red'):	

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):	

				print("Red switch is securely affixed to inside of the panel. You can't take it.")

			else:

				if (player_input == 'take red switch'):
					print("You don't see any red switch here.")

				if (player_input == 'take red'):
					print("You don't see anything red in here.")

			return()

		# PRESS/PUSH RED SWITCH
		if (player_input == 'press red switch' or 
			player_input == 'press red' or		
			player_input == 'push red switch' or 
			player_input == 'push red'):		

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):	

				print("You press the red switch.")

				if (game_states["bronzebox"] == 0 and 
					game_states["bronzebox"] != 2):
					
					game_states["bronzebox"] = 1
					return()

				if (game_states["bronzebox"] != 0 and 
					game_states["bronzebox"] != 2):

					game_states["bronzebox"] = 0
					return()

				if (game_states["bronzebox"] == 0 and 
					game_states["bronzebox"] == 2):

					game_states["bronzebox"] = 1
					print("**DEBUG ONLY SITUATION - SETTING BRONZE BOX STATE TO 1**")
					return()

				if (game_states["bronzebox"] == 1 and 
					game_states["bronzebox"] == 2):

					game_states["bronzebox"] = 0
					print("**DEBUG ONLY SITUATION - SETTING BRONZE BOX STATE TO 0**")
					return()	

			else:

				if (player_input == 'press red switch' or 
					player_input == 'push red switch'):

					print("You don't see any red switch here.")

				if (player_input == 'press red' or 
					player_input == 'push red'):

					print("You don't see anything red in here.")

			return()				

		# LOOK BLUE SWITCH
		if (player_input == 'look blue switch' or 
			player_input == 'look blue'):

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):	

				print("Blue switch inside the access panel is a square push button switch the size of a coin.")

			else:

				if (player_input == 'look blue switch'):
					print("You don't see any blue switch here.")

				if (player_input == 'look blue'):
					print("You don't see anything blue in here.")

			return()		

		# TAKE BLUE SWITCH
		if (player_input == 'take blue switch' or 
			player_input == 'take blue'):	

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):	

				print("Blue switch is securely affixed to inside of the panel. You can't take it.")

			else:

				if (player_input == 'take blue switch'):
					print("You don't see any blue switch here.")

				if (player_input == 'take blue'):
					print("You don't see anything blue in here.")

			return()							

		# PRESS/PUSH BLUE SWITCH
		if (player_input == 'press blue switch' or 
			player_input == 'press blue' or		
			player_input == 'push blue switch' or 
			player_input == 'push blue'):		

			if (game_states["roomid"] == 4 and 
				game_states["southaccesspanel"] == 2):	
				print("You press the blue switch.")

				if (game_states["eastdoor"] == 0):
					game_states["eastdoor"] = 1
					return()

				if (game_states["eastdoor"] != 0):
					game_states["eastdoor"] = 0
					return()

			else:

				if (player_input == 'press blue switch' or 
					player_input == 'push blue switch'):
					print("You don't see any blue switch here.")

				if (player_input == 'press blue' or 
					player_input == 'push blue'):
					print("You don't see anything blue in here.")

			return()						

		# LOOK BLACK SWITCH
		if (player_input == 'look black switch' or 
			player_input == 'look black'):

			if (game_states["roomid"] == 5 and 
				game_states["northaccesspanel"] != 0):	
				print("Black switch inside the access panel is a round push button switch the size of a coin.")

			else:

				if (player_input == 'look black switch'):
					print("You don't see any black switch here.")	

				if (player_input == 'look black'):
					print("You don't see anything black in here.")

			return()					

		# TAKE BLACK SWITCH
		if (player_input == 'take black switch' or 
			player_input == 'take black'):	

			if (game_states["roomid"] == 5 and
				game_states["northaccesspanel"] != 0):	
				print("Black switch is securely affixed to inside of the panel. You can't take it.")

			else:

				if (player_input == 'take black switch'):
					print("You don't see any black switch here.")	

				if (player_input == 'take black'):
					print("You don't see anything black in here.")

			return()					

		# PRESS/PUSH BLACK SWITCH
		if (player_input == 'press black switch' or 
			player_input == 'press black' or	
			player_input == 'push black switch' or 
			player_input == 'push black'):		

			if (game_states["roomid"] == 5 and 
				game_states["northaccesspanel"] != 0):	
				print("You press the black switch.")	

				if (game_states["southdoor"] == 0):
					game_states["southdoor"] = 1
					return()

				if (game_states["southdoor"] != 0):
					game_states["southdoor"] = 0
					return()

			else:

				if (player_input == 'press black switch' or 
					player_input == 'push black switch'):
						print("You don't see any black switch here.")

				if (player_input == 'press black' or 
					player_input == 'push black'):
					print("You don't see anything black in here.")

			return()				

		# LOOK WHITE SWITCH
		if (player_input == 'look white switch' or 
			player_input == 'look white'):

			if (game_states["roomid"] == 5 and 
				game_states["northaccesspanel"] != 0):	
				print("White switch inside the access panel is a round push button switch the size of a coin.")

			else:

				if (player_input == 'look white switch'):
					print("You don't see any white switch here.")	

				if (player_input == 'look white'):
					print("You don't see anything white in here.")

			return()				

		# TAKE WHITE SWITCH
		if (player_input == 'take white switch' or 
			player_input == 'take white'):

			if (game_states["roomid"] == 5 and 
				game_states["northaccesspanel"] != 0):	
				print("White switch is securely affixed to inside of the panel. You can't take it.")
			
			else:

				if (player_input == 'take white switch'):
					print("You don't see any white switch here.")
						

				if (player_input == 'take white'):
					print("You don't see anything white in here.")
						
			return()		
					

		# PRESS/PUSH WHITE SWITCH
		if (player_input == 'press white switch' or 
			player_input == 'press white' or		
			player_input == 'push white switch' or 
			player_input == 'push white'):	

			if (game_states["roomid"] == 5 and 
				game_states["northaccesspanel"] != 0):	
				print("You press the white switch.")

				if (game_states["southaccesspanel"] == 0):
					game_states["southaccesspanel"] = 1
					return()
				

				if (game_states["southaccesspanel"] != 0):
					game_states["southaccesspanel"] = 0
					return()

			else:

				if (player_input == 'press white switch' or 
					player_input == 'push white switch'):
					print("You don't see any white switch here.")
				
				if (player_input == 'press white' or 
					player_input == 'push white'):
					print("You don't see anything white in here.")
									
			return()			
						

		# LOOK GREEN SWITCH
		if (player_input == 'look green switch' or 
			player_input == 'look green'):	

			if (game_states["roomid"] == 2):	
				print("Green switch on the wall is a push button switch the size of a coin.")
			
			else:

				if (player_input == 'look green switch'):	
					print("You don't see any green switch here.")
				
				if (player_input == 'look green'):	
					print("You don't see anything green in here.")

			return()
					

		# TAKE GREEN SWITCH
		if (player_input == 'take green switch' or 
			player_input == 'take green'):	

			if (game_states["roomid"] == 2):	
				print("Green switch is securely affixed to the wall.  You can't take it.")

			else:

				if (player_input == 'take green switch'):
					print("You don't see any green switch here.")
				
				if (player_input == 'take green switch'):
					print("You don't see anything green in here.")
				
			return()				
				
		# PRESS GREEN SWITCH
		if (player_input == 'press green switch' or 
			player_input == 'push green switch' or
			player_input == 'press green' or 
			player_input == 'push green'):

			if (game_states["roomid"] == 2):
				print("You press the green switch.")

				if (game_states["northdoor"] == 0 and 
					game_states["bronzebox"] != 2):
					game_states["northdoor"] = 1
					return()
				

				if ((game_states["northdoor"] != 0 and 
					game_states["bronzebox"] != 2) or 
					game_states["bronzebox"] == 2):
					game_states["northdoor"] = 0
					return()
								
			else: 
				if (player_input == 'press green switch' or 
					player_input == 'push green switch'):	
					print("You don't see any green switch here.")
						
				if (player_input == 'press green' or 
					player_input == 'push green'):	
					print("You don't see anything green in here.")
						
			return()					
					
		# LOOK YELLOW SWITCH
		if (player_input == 'look yellow switch' or 
			player_input == 'look yellow'):	

			if (game_states["roomid"] == 2 and 
				"paper" in inventory):
				print("Yellow switch on the floor is a small oval switch.")
				
			else:

				if (player_input == 'look yellow switch'):	
					print("You don't see any yellow switch here.")
					
				if (player_input == 'look yellow'):	
					print("You don't see anything yellow in here.")
					
			return()
				
		# TAKE YELLOW SWITCH
		if (player_input == 'take yellow switch' or 
			player_input == 'take yellow'):

			if (game_states["roomid"] == 2 and 
				"paper" in inventory):
				print("Yellow switch is securely affixed to the floor.  You can't take it.")
			
			else:

				if (player_input == 'take yellow switch'):	
					print("You don't see any yellow switch here.")
					
				if (player_input == 'take yellow'):	
					print("You don't see anything yellow in here.")
					
			return()			
			
		# PRESS YELLOW SWITCH
		if (player_input == 'press yellow switch' or 
			player_input == 'push yellow switch' or
			player_input == 'press yellow' or 
			player_input == 'push yellow'):

			if (game_states["roomid"] == 2 and
				"paper" in inventory):
				print("You press the yellow switch.")

				if (game_states["eastdoor"] != 0):
					print("The light above the door in the west is now red.")
					game_states["eastdoor"] = 0
					return()
										
				if (game_states["eastdoor"] == 0):
					print("The light above the door in the west is now green.")
					game_states["eastdoor"] = 1
					return()

			else:

				if (player_input == 'press yellow switch' or 
					player_input == 'push yellow switch'):	
					print("You don't see any yellow switch here.")
					
				if (player_input == 'press yellow' or 
					player_input == 'push yellow'):	
					print("You don't see anything yellow in here.")

			return()
						
		# LOOK BOX
		if (player_input == 'look box'):

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 4):	
				print("There isn't any box here.")
						
			if (game_states["roomid"] == 2):
				print("It's a box made out of bronze.")
				print("You can't see any keyhole on it.")	

				if (game_states["bronzebox"] != 2):
					print("The bronze box is currently closed.")
				
				if (game_states["bronzebox"] == 2):
					print("The bronze box is currently open.")

					if ("aluminum key" not in inventory):
						print("There is an aluminum key inside the bronze box.")
					
					if ("aluminum key" in inventory):
						print("The bronze box is empty.")

			if (game_states["roomid"] == 3):
				print("The box is made out of titanium.")
				print("There is a keyhole on a side of the titanium box.")	

				if (game_states["titaniumbox"] == 0):
					print("The titanium box is currently closed.")
				
				if (game_states["titaniumbox"] != 0):
					print("The titanium box is currently open.")

					if ("iron key" not in inventory):
						print("There is an iron key inside the titanium box.")
					
					if ("iron key" in inventory):
						print("The titanium box is empty.")
					
			if (game_states["roomid"] == 5):
				print("The box is made out of steel.")
				print("There is a keyhole on a side of the steel box.")		

				if (game_states["steelbox"] == 0):
					print("The steel box is currently closed.")
				
				if (game_states["steelbox"] != 0):
					print("The steel box is currently open.")

					if ("batteries" not in inventory):
						print("There are batteries inside the steel box.")
					
					if ("batteries" in inventory):
						print("The steel box is empty.")
					
			return()				
					
		# OPEN BOX
		if (player_input == 'open box'):

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 4):	
				print("There isn't any box here.")
							
			if (game_states["roomid"] == 2):

				if (game_states["bronzebox"] == 2):
					print("The bronze box is already open.")

					if ("aluminum key" not in inventory):
						print("There is an aluminum key inside the bronze box.")
					
					if ("aluminum key" in inventory):
						print("The bronze box is empty.")
						
				if (game_states["bronzebox"] == 1):
					print("You open the bronze box.")
					game_states["bronzebox"] = 2
					game_states["northdoor"] = 0
					game_states["southdoor"] = 0
					game_states["westdoor"] = 1

					if ("aluminum key" not in inventory):
						print("There is an aluminum key inside the bronze box.")
					
					if ("aluminum key" in inventory):
						print("The bronze box is empty.")
									
				if (game_states["bronzebox"] == 0):
					print("The bronze box is securely locked.  You can't open it.")
								
			if (game_states["roomid"] == 3):

				if (game_states["titaniumbox"] == 0):
					print("You can't open the titanium box.")
					print("You will need to unlock the titanium box with a key.")
				
				if (game_states["titaniumbox"] != 0):
					print("The titanium box is already open.")

					if ("iron key" not in inventory):
						print("There is a iron key inside the titanium box.")
					
					if ("iron key" in inventory):
						print("The titanium box is empty.")
										
			if (game_states["roomid"] == 5):

				if (game_states["steelbox"] == 0):
					print("You can't open the steel box.")
					print("You will need to unlock the steel box with a key.")
				
				if (game_states["steelbox"] != 0):
					print("The steel box is already open.")

					if ("batteries" not in inventory):
						print("There are batteries inside the steel box.")
					
					if ("batteries" in inventory):
						print("The steel box is empty.")

			return()				
		
		# UNLOCK BOX WITH KEY / OPEN BOX WITH KEY / UNLOCK BOX
		if (player_input == 'use key on box' or 	
			player_input == 'use key to open box' or 		
			player_input == 'use key to unlock box' or 					
			player_input == 'open box with key' or 
			player_input == 'open box using key' or 			
			player_input == 'unlock box using key' or 
			player_input == 'unlock box' or 			
			player_input == 'unlock box with key'):	

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 4):
				print("There isn't any in box here.")

			if (game_states["roomid"] == 2):
				print("There is no keyhole on the bronze box.")
				print("There must be a way to unlock the box.")	
			
			if (game_states["roomid"] == 3 or 
				game_states["roomid"] == 5):

				if ("aluminum key" in inventory or 
					"brass key" in inventory or 
					"iron key" in inventory):
					print("Please specify which key to unlock the box with.")
				
				if ("aluminum key" not in inventory and 
					"brass key" not in inventory and 
					"iron key" not in inventory):
					print("You don't have any key.")					
							
			return()					
				
		# UNLOCK BOX WITH ALUMINUM KEY / OPEN BOX WITH ALUMINUM KEY
		if (player_input == 'use aluminum key on box' or
		    player_input == 'use aluminum on box' or 											 
			player_input == 'use aluminum key to open box' or 
			player_input == 'use aluminum to open box' or 			
			player_input == 'use aluminum key to unlock box' or 
			player_input == 'use aluminum to unlock box' or 						
			player_input == 'open box with aluminum key' or 
			player_input == 'open box with aluminum' or 				
			player_input == 'open box using aluminum key' or 
			player_input == 'open box using aluminum' or 					
			player_input == 'unlock box using aluminum key' or 
			player_input == 'unlock box using aluminum' or 							
			player_input == 'unlock box with aluminum key' or 			
			player_input == 'unlock box with aluminum'):	

			if (game_states["roomid"] == 2 and 
				"aluminum key" in inventory):
				print("There is no keyhole on the bronze box.")
			
			if (game_states["roomid"] == 3 and 
				"aluminum key" in inventory):
				print("You attempted to use aluminum key to unlock the "
				       "titanium box, but the aluminum key doens't fit "
					   "in the keyhole.")
				

			if (game_states["roomid"] == 5 and 
				"aluminum key" in inventory):

				if (game_states["steelbox"] != 0):
					print("The steel box is already open.")

				if (game_states["steelbox"] == 0):
					print("You insert the aluminum key into the keyhole on the steel box.")
					print("The key fits.  After turning the key, the steel box automatically opens.")
					print("You take the aluminum key out of the keyhole.")				
					game_states["steelbox"] = 1
				

				if ("batteries" not in inventory):
					print("There are batteries inside the steel box.")
				

				if ("batteries" in inventory):
					print("The steel box is empty.")

			if ("aluminum key" not in inventory):

				if (player_input == 'use aluminum key on box' or					 
					player_input == 'use aluminum key to open box' or 
					player_input == 'use aluminum key to unlock box' or 						
					player_input == 'open box with aluminum key' or 		
					player_input == 'open box using aluminum key' or 			
					player_input == 'unlock box using aluminum key' or 					
					player_input == 'unlock box with aluminum key'):
					print("What aluminum key?")
				
				if (player_input == 'use aluminum on box' or						 
					player_input == 'use aluminum to open box' or 
					player_input == 'use aluminum to unlock box' or 						
					player_input == 'open box with aluminum' or 			
					player_input == 'open box using aluminum' or 			
					player_input == 'unlock box using aluminum' or 						
					player_input == 'unlock box with aluminum' or 			
					player_input == 'unlock box with aluminum'):
					print("What aluminum?")
				
				if (game_states["roomid"] == 1 or 
					game_states["roomid"] == 4):
					print("You don't see any box here.")

			return()													

		# UNLOCK BOX WITH BRASS KEY / OPEN BOX WITH BRASS KEY
		if (player_input == 'use brass key on box' or
		    player_input == 'use brass on box' or 											 
			player_input == 'use brass key to open box' or 
			player_input == 'use brass to open box' or 			
			player_input == 'use brass key to unlock box' or 
			player_input == 'use brass to unlock box' or 						
			player_input == 'open box with brass key' or 
			player_input == 'open box with brass' or 				
			player_input == 'open box using brass key' or 
			player_input == 'open box using brass' or 					
			player_input == 'unlock box using brass key' or 
			player_input == 'unlock box using brass' or 							
			player_input == 'unlock box with brass key' or 			
			player_input == 'unlock box with brass'):	

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 4):
				print("You don't see any box here.")

			if (game_states["roomid"] == 2 and 
				"brass key" in inventory):
				print("There is no keyhole on the bronze box.")
			
			if (game_states["roomid"] == 3 and 
				"brass key" in inventory):

				if (game_states["titaniumbox"] != 0):
					print("The titanium box is already open.")

				if (game_states["titaniumbox"] == 0):
					print("You insert the brass key into the keyhole on the titanium box.")
					print("The key fits.  After turning the key, the titanium box automatically opens.")
					print("You take the brass key out of the keyhole.")				
					game_states["titaniumbox"] = 1
				
				if ("iron key" not in inventory):
					print("There is an iron key inside the titanium box.")

				if ("iron key" in inventory):
					print("The titanium box is empty.")
					
			if (game_states["roomid"] == 5 and 
				"brass key" in inventory):
				print("You attempted to use brass key to unlock the "
				       "steel box, but the brass key doens't fit "
					   "in the keyhole.")
				
			if ("brass key" not in inventory):

				if (player_input == 'use brass key on box' or					 
					player_input == 'use brass key to open box' or 
					player_input == 'use brass key to unlock box' or 						
					player_input == 'open box with brass key' or 		
					player_input == 'open box using brass key' or 			
					player_input == 'unlock box using brass key' or 					
					player_input == 'unlock box with brass key'):
					print("What brass key?")

				if (player_input == 'use brass on box' or						 
					player_input == 'use brass to open box' or 
					player_input == 'use brass to unlock box' or 						
					player_input == 'open box with brass' or 			
					player_input == 'open box using brass' or 			
					player_input == 'unlock box using brass' or 						
					player_input == 'unlock box with brass' or 			
					player_input == 'unlock box with brass'):
					print("What brass?")
			
			return()											

		# UNLOCK BOX WITH IRON KEY / OPEN BOX WITH IRON KEY
		if (player_input == 'use iron key on box' or
		    player_input == 'use iron on box' or 											 
			player_input == 'use iron key to open box' or 
			player_input == 'use iron to open box' or 			
			player_input == 'use iron key to unlock box' or 
			player_input == 'use iron to unlock box' or 						
			player_input == 'open box with iron key' or 
			player_input == 'open box with iron' or 				
			player_input == 'open box using iron key' or 
			player_input == 'open box using iron' or 					
			player_input == 'unlock box using iron key' or 
			player_input == 'unlock box using iron' or 							
			player_input == 'unlock box with iron key' or 			
			player_input == 'unlock box with iron'):	

			if (game_states["roomid"] == 2 and 
				"iron key" in inventory):
				print("There is no keyhole on the bronze box.")
			
			if (game_states["roomid"] == 3 and 
				"iron key" in inventory):
				print("You attempted to use iron key to unlock the "
				       "titanium box, but the iron key doens't fit "
					   "in the keyhole.")
				
			if (game_states["roomid"] == 3 and 
				"iron key" in inventory):
				print("You attempted to use iron key to unlock the "
				       "steel box, but the iron key doens't fit "
					   "in the keyhole.")
				
			if ("iron key" not in inventory):

				if (player_input == 'use iron key on box' or					 
					player_input == 'use iron key to open box' or 
					player_input == 'use iron key to unlock box' or 						
					player_input == 'open box with iron key' or 		
					player_input == 'open box using iron key' or 			
					player_input == 'unlock box using iron key' or 					
					player_input == 'unlock box with iron key'):
					print("What iron key?")
				
				if (player_input == 'use iron on box' or						 
					player_input == 'use iron to open box' or 
					player_input == 'use iron to unlock box' or 						
					player_input == 'open box with iron' or 			
					player_input == 'open box using iron' or 			
					player_input == 'unlock box using iron' or 						
					player_input == 'unlock box with iron' or 			
					player_input == 'unlock box with iron'):

					print("What iron?")
				
				if (game_states["roomid"] == 1 or 
					game_states["roomid"] == 4):
					print("You don't see any box here.")

			return()								
							
		# CLOSE BOX
		if (player_input == 'close box'):

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 4):
				print("There isn't any box here.")
						
			if (game_states["roomid"] == 2):

				if (game_states["bronzebox"] != 2):
					print("The bronze box is already closed.")
								
				if (game_states["bronzebox"] == 2):
					print("You close the bronze box.")
					game_states["bronzebox"] = 1
					game_states["northdoor"] = 0
					game_states["southdoor"] = 0
					game_states["westdoor"] = 0
				
			if (game_states["roomid"] == 3):

				if (game_states["titaniumbox"] == 0):
					print("The titanium box is already closed.")
							
				if (game_states["titaniumbox"] != 0):
					print("You close the titanium box.  The titanium box is now locked.")
					game_states["titaniumbox"] = 0
				
			if (game_states["roomid"] == 5):

				if (game_states["steelbox"] == 0):
					print("The steel box is already closed.")
							
				if (game_states["steelbox"] != 0):
					print("You close the steel box.  The steel box is now locked.")
					game_states["steelbox"] = 0
				
			return()
				
		# TAKE BOX
		if (player_input == 'take box'):

			if (game_states["roomid"] == 1 or 
				game_states["roomid"] == 4):
				print("There isn't any box here.")
			
			if (game_states["roomid"] == 2):
				print("The bronze box seems to be an integral part of the floor, you can't take it.")

			if (game_states["roomid"] == 3):
				print("The titanium box seems to be fused to the floor, you can't take it.")
						
			if (game_states["roomid"] == 5):
				print("The steel box is too heavy to lift, you can't take it.")
					
			return()
				
		# LOOK BRONZE BOX
		if (player_input == 'look bronze' or 
			player_input == 'look bronze box'):

			if (game_states["roomid"] == 2):

				print("The box is made out of bronze.")
				print("You can't see any keyhole on it.")	

				if (game_states["bronzebox"] != 2):
					print("The bronze box is currently closed.")
				
				if (game_states["bronzebox"] == 2):
					print("The bronze box is currently open.")

					if ("aluminum key" not in inventory):
						print("There is an aluminum key inside the bronze box.")

					if ("aluminum key" in inventory):
						print("The bronze box is empty.")
					
			if (game_states["roomid"] != 2):

				if (player_input == 'look bronze box'):	
					print("There isn't any bronze box here.")
						
				if (player_input == 'look bronze'):	
					print("There isn't anything bronze in here.")

			return()				
			
		# UNLOCK BRONZE BOX
		if (player_input == 'unlock bronze box' or 
			player_input == 'unlock bronze'):

			if (game_states["roomid"] == 2):
				print("There is no keyhole on the bronze box.")
				print("There must be a way to unlock the box.")				
			
			if (game_states["roomid"] != 2):

				if (player_input == 'unlock bronze box'):
					print("There is no bronze box here.")
				
				if (player_input == 'unlock bronze'):
					print("There isn't anything bronze in here.")
		
			return()							
						
		# UNLOCK BRONZE BOX WITH KEY / OPEN BRONZE BOX WITH KEY
		if (player_input == 'use key on bronze box' or 
			player_input == 'use key on bronze' or 		
			player_input == 'use key to open bronze box' or 
			player_input == 'use key to open bronze' or 			
			player_input == 'use key to unlock bronze box' or 
			player_input == 'use key to unlock bronze' or						
			player_input == 'open bronze box with key' or 
			player_input == 'open bronze box using key' or 
			player_input == 'open bronze with key' or 
			player_input == 'open bronze using key' or 			
			player_input == 'unlock bronze box using key' or 
			player_input == 'unlock bronze box with key' or 			
			player_input == 'unlock bronze using key' or 
			player_input == 'unlock bronze with key'):	

			if (game_states["roomid"] == 2):

				if ("aluminum key" in inventory or 
					"brass key" in inventory or 
					"iron key" in inventory):
					print("There is no keyhole on the bronze box.")

			if (game_states["roomid"] != 2):

				if (player_input == 'use key on bronze box' or 
					player_input == 'use key to open bronze box' or 
					player_input == 'open bronze box with key' or 
					player_input == 'open bronze box using key' or 
					player_input == 'unlock bronze box using key' or 
					player_input == 'unlock bronze box with key' or 			
					player_input == 'use key to unlock bronze box'):
					print("There is no bronze box here.")

				if (player_input == 'use key on bronze' or 
					player_input == 'use key to open bronze' or 
					player_input == 'open bronze with key' or 
					player_input == 'open bronze using key' or 
					player_input == 'unlock bronze using key' or 
					player_input == 'unlock bronze with key' or 			
					player_input == 'use key to unlock bronze'):
					print("There isn't anything bronze in here.")
				
			if ("aluminum key" not in inventory and "brass key" not in inventory and "iron key" not in inventory):
				print("What key?")
					
			return()						
						
		# UNLOCK BRONZE BOX WITH ALUMINUM KEY
		if (player_input == 'use aluminum key on bronze box' or
			player_input == 'use aluminum key on bronze' or 
		    player_input == 'use aluminum on bronze box' or 				
			player_input == 'use aluminum on bronze' or 							 
			player_input == 'use aluminum key to open bronze box' or 
			player_input == 'use aluminum key to open bronze' or 
			player_input == 'use aluminum to open bronze box' or 
			player_input == 'use aluminum to open bronze' or 			
			player_input == 'use aluminum key to unlock bronze' or
			player_input == 'use aluminum key to unlock bronze box' or 
			player_input == 'use aluminum to unlock bronze' or
			player_input == 'use aluminum to unlock bronze box' or 						
			player_input == 'open bronze box with aluminum key' or 
			player_input == 'open bronze with aluminum key' or 	
			player_input == 'open bronze box with aluminum' or 
			player_input == 'open bronze with aluminum' or 					
			player_input == 'open bronze box using aluminum key' or 
			player_input == 'open bronze using aluminum key' or 
			player_input == 'open bronze box using aluminum' or 
			player_input == 'open bronze using aluminum' or 					
			player_input == 'unlock bronze box using aluminum key' or 
			player_input == 'unlock bronze using aluminum key' or 
			player_input == 'unlock bronze box using aluminum' or 
			player_input == 'unlock bronze using aluminum' or 							
			player_input == 'unlock bronze box with aluminum key' or 			
			player_input == 'unlock bronze with aluminum key' or
			player_input == 'unlock bronze box with aluminum' or 			
			player_input == 'unlock bronze with aluminum'):	

			if (game_states["roomid"] == 2 and 
				"aluminum key" in inventory):
				print("There is no keyhole on the bronze box.")
			
			if (game_states["roomid"] != 2):	

				if (player_input == 'use aluminum key on bronze box' or
					player_input == 'use aluminum on bronze box' or 									 
					player_input == 'use aluminum key to open bronze box' or 
					player_input == 'use aluminum to open bronze box' or 	
					player_input == 'use aluminum key to unlock bronze box' or 
					player_input == 'use aluminum to unlock bronze box' or 						
					player_input == 'open bronze box with aluminum key' or 	
					player_input == 'open bronze box with aluminum' or 				
					player_input == 'open bronze box using aluminum key' or 
					player_input == 'open bronze box using aluminum' or 			
					player_input == 'unlock bronze box using aluminum key' or 
					player_input == 'unlock bronze box using aluminum' or 					
					player_input == 'unlock bronze box with aluminum key' or 			
					player_input == 'unlock bronze box with aluminum'):

					print("There is no bronze box here.")
				
				if (player_input == 'use aluminum key on bronze' or
					player_input == 'use aluminum on bronze' or 									 
					player_input == 'use aluminum key to open bronze' or 
					player_input == 'use aluminum to open bronze' or 	
					player_input == 'use aluminum key to unlock bronze' or 
					player_input == 'use aluminum to unlock bronze' or 						
					player_input == 'open bronze with aluminum key' or 	
					player_input == 'open bronze with aluminum' or 				
					player_input == 'open bronze using aluminum key' or 
					player_input == 'open bronze using aluminum' or 			
					player_input == 'unlock bronze using aluminum key' or 
					player_input == 'unlock bronze using aluminum' or 					
					player_input == 'unlock bronze with aluminum key' or 			
					player_input == 'unlock bronze with aluminum'):

					print("There isn't anything bronze in here.")
					
			if ("aluminum key" not in inventory):

				if (player_input == 'use aluminum key on bronze box' or
					player_input == 'use aluminum key on bronze' or 						 
					player_input == 'use aluminum key to open bronze box' or 
					player_input == 'use aluminum key to open bronze' or 	
					player_input == 'use aluminum key to unlock bronze' or
					player_input == 'use aluminum key to unlock bronze box' or 						
					player_input == 'open bronze box with aluminum key' or 
					player_input == 'open bronze with aluminum key' or 				
					player_input == 'open bronze box using aluminum key' or 
					player_input == 'open bronze using aluminum key' or 				
					player_input == 'unlock bronze box using aluminum key' or 
					player_input == 'unlock bronze using aluminum key' or 						
					player_input == 'unlock bronze box with aluminum key' or 			
					player_input == 'unlock bronze with aluminum key'):

					print("What aluminum key?")
				
				if (player_input == 'use aluminum on bronze box' or
					player_input == 'use aluminum on bronze' or 						 
					player_input == 'use aluminum to open bronze box' or 
					player_input == 'use aluminum to open bronze' or 	
					player_input == 'use aluminum to unlock bronze' or
					player_input == 'use aluminum to unlock bronze box' or 						
					player_input == 'open bronze box with aluminum' or 
					player_input == 'open bronze with aluminum' or 				
					player_input == 'open bronze box using aluminum' or 
					player_input == 'open bronze using aluminum' or 				
					player_input == 'unlock bronze box using aluminum' or 
					player_input == 'unlock bronze using aluminum' or 						
					player_input == 'unlock bronze box with aluminum' or 			
					player_input == 'unlock bronze with aluminum' or
					player_input == 'unlock bronze box with aluminum'):

					print("What aluminum?")
				
			return()								
					
		# UNLOCK BRONZE BOX WITH BRASS KEY
		if (player_input == 'use brass key on bronze box' or
			player_input == 'use brass key on bronze' or 
		    player_input == 'use brass on bronze box' or 				
			player_input == 'use brass on bronze' or 							 
			player_input == 'use brass key to open bronze box' or 
			player_input == 'use brass key to open bronze' or 
			player_input == 'use brass to open bronze box' or 
			player_input == 'use brass to open bronze' or 			
			player_input == 'use brass key to unlock bronze' or
			player_input == 'use brass key to unlock bronze box' or 
			player_input == 'use brass to unlock bronze' or
			player_input == 'use brass to unlock bronze box' or 						
			player_input == 'open bronze box with brass key' or 
			player_input == 'open bronze with brass key' or 	
			player_input == 'open bronze box with brass' or 
			player_input == 'open bronze with brass' or 					
			player_input == 'open bronze box using brass key' or 
			player_input == 'open bronze using brass key' or 
			player_input == 'open bronze box using brass' or 
			player_input == 'open bronze using brass' or 					
			player_input == 'unlock bronze box using brass key' or 
			player_input == 'unlock bronze using brass key' or 
			player_input == 'unlock bronze box using brass' or 
			player_input == 'unlock bronze using brass' or 							
			player_input == 'unlock bronze box with brass key' or 			
			player_input == 'unlock bronze with brass key' or
			player_input == 'unlock bronze box with brass' or 			
			player_input == 'unlock bronze with brass'):	

			if (game_states["roomid"] == 2 and "brass key" in inventory):
				print("There is no keyhole on the bronze box.")
			
			if (game_states["roomid"] != 2):	

				if (player_input == 'use brass key on bronze box' or
					player_input == 'use brass on bronze box' or 									 
					player_input == 'use brass key to open bronze box' or 
					player_input == 'use brass to open bronze box' or 	
					player_input == 'use brass key to unlock bronze box' or 
					player_input == 'use brass to unlock bronze box' or 						
					player_input == 'open bronze box with brass key' or 	
					player_input == 'open bronze box with brass' or 				
					player_input == 'open bronze box using brass key' or 
					player_input == 'open bronze box using brass' or 			
					player_input == 'unlock bronze box using brass key' or 
					player_input == 'unlock bronze box using brass' or 					
					player_input == 'unlock bronze box with brass key' or 			
					player_input == 'unlock bronze box with brass'):

					print("There is no bronze box here.")
				
				if (player_input == 'use brass key on bronze' or
					player_input == 'use brass on bronze' or 									 
					player_input == 'use brass key to open bronze' or 
					player_input == 'use brass to open bronze' or 	
					player_input == 'use brass key to unlock bronze' or 
					player_input == 'use brass to unlock bronze' or 						
					player_input == 'open bronze with brass key' or 	
					player_input == 'open bronze with brass' or 				
					player_input == 'open bronze using brass key' or 
					player_input == 'open bronze using brass' or 			
					player_input == 'unlock bronze using brass key' or 
					player_input == 'unlock bronze using brass' or 					
					player_input == 'unlock bronze with brass key' or 			
					player_input == 'unlock bronze with brass'):

					print("There isn't anything bronze in here.")
					
			if ("brass key" not in inventory):

				if (player_input == 'use brass key on bronze box' or
					player_input == 'use brass key on bronze' or 						 
					player_input == 'use brass key to open bronze box' or 
					player_input == 'use brass key to open bronze' or 	
					player_input == 'use brass key to unlock bronze' or
					player_input == 'use brass key to unlock bronze box' or 						
					player_input == 'open bronze box with brass key' or 
					player_input == 'open bronze with brass key' or 				
					player_input == 'open bronze box using brass key' or 
					player_input == 'open bronze using brass key' or 				
					player_input == 'unlock bronze box using brass key' or 
					player_input == 'unlock bronze using brass key' or 						
					player_input == 'unlock bronze box with brass key' or 			
					player_input == 'unlock bronze with brass key'):

					print("What brass key?")
				
				if (player_input == 'use brass on bronze box' or
					player_input == 'use brass on bronze' or 						 
					player_input == 'use brass to open bronze box' or 
					player_input == 'use brass to open bronze' or 	
					player_input == 'use brass to unlock bronze' or
					player_input == 'use brass to unlock bronze box' or 						
					player_input == 'open bronze box with brass' or 
					player_input == 'open bronze with brass' or 				
					player_input == 'open bronze box using brass' or 
					player_input == 'open bronze using brass' or 				
					player_input == 'unlock bronze box using brass' or 
					player_input == 'unlock bronze using brass' or 						
					player_input == 'unlock bronze box with brass' or 			
					player_input == 'unlock bronze with brass' or
					player_input == 'unlock bronze box with brass'):

					print("What brass?")
			
			return()								
									

		# UNLOCK BRONZE BOX WITH IRON KEY
		if (player_input == 'use iron key on bronze box' or
			player_input == 'use iron key on bronze' or 
		    player_input == 'use iron on bronze box' or 				
			player_input == 'use iron on bronze' or 							 
			player_input == 'use iron key to open bronze box' or 
			player_input == 'use iron key to open bronze' or 
			player_input == 'use iron to open bronze box' or 
			player_input == 'use iron to open bronze' or 			
			player_input == 'use iron key to unlock bronze' or
			player_input == 'use iron key to unlock bronze box' or 
			player_input == 'use iron to unlock bronze' or
			player_input == 'use iron to unlock bronze box' or 						
			player_input == 'open bronze box with iron key' or 
			player_input == 'open bronze with iron key' or 	
			player_input == 'open bronze box with iron' or 
			player_input == 'open bronze with iron' or 					
			player_input == 'open bronze box using iron key' or 
			player_input == 'open bronze using iron key' or 
			player_input == 'open bronze box using iron' or 
			player_input == 'open bronze using iron' or 					
			player_input == 'unlock bronze box using iron key' or 
			player_input == 'unlock bronze using iron key' or 
			player_input == 'unlock bronze box using iron' or 
			player_input == 'unlock bronze using iron' or 							
			player_input == 'unlock bronze box with iron key' or 			
			player_input == 'unlock bronze with iron key' or
			player_input == 'unlock bronze box with iron' or 			
			player_input == 'unlock bronze with iron'):	

			if (game_states["roomid"] == 2 and "iron key" in inventory):
				print("There is no keyhole on the bronze box.")
			
			if (game_states["roomid"] != 2):	

				if (player_input == 'use iron key on bronze box' or
					player_input == 'use iron on bronze box' or 									 
					player_input == 'use iron key to open bronze box' or 
					player_input == 'use iron to open bronze box' or 	
					player_input == 'use iron key to unlock bronze box' or 
					player_input == 'use iron to unlock bronze box' or 						
					player_input == 'open bronze box with iron key' or 	
					player_input == 'open bronze box with iron' or 				
					player_input == 'open bronze box using iron key' or 
					player_input == 'open bronze box using iron' or 			
					player_input == 'unlock bronze box using iron key' or 
					player_input == 'unlock bronze box using iron' or 					
					player_input == 'unlock bronze box with iron key' or 			
					player_input == 'unlock bronze box with iron'):

					print("There is no bronze box here.")
				
				if (player_input == 'use iron key on bronze' or
					player_input == 'use iron on bronze' or 									 
					player_input == 'use iron key to open bronze' or 
					player_input == 'use iron to open bronze' or 	
					player_input == 'use iron key to unlock bronze' or 
					player_input == 'use iron to unlock bronze' or 						
					player_input == 'open bronze with iron key' or 	
					player_input == 'open bronze with iron' or 				
					player_input == 'open bronze using iron key' or 
					player_input == 'open bronze using iron' or 			
					player_input == 'unlock bronze using iron key' or 
					player_input == 'unlock bronze using iron' or 					
					player_input == 'unlock bronze with iron key' or 			
					player_input == 'unlock bronze with iron'):

					print("There isn't anything bronze in here.")
				
			if ("iron key" not in inventory):

				if (player_input == 'use iron key on bronze box' or
					player_input == 'use iron key on bronze' or 						 
					player_input == 'use iron key to open bronze box' or 
					player_input == 'use iron key to open bronze' or 	
					player_input == 'use iron key to unlock bronze' or
					player_input == 'use iron key to unlock bronze box' or 						
					player_input == 'open bronze box with iron key' or 
					player_input == 'open bronze with iron key' or 				
					player_input == 'open bronze box using iron key' or 
					player_input == 'open bronze using iron key' or 				
					player_input == 'unlock bronze box using iron key' or 
					player_input == 'unlock bronze using iron key' or 						
					player_input == 'unlock bronze box with iron key' or 			
					player_input == 'unlock bronze with iron key'):

					print("What iron key?")
				
				if (player_input == 'use iron on bronze box' or
					player_input == 'use iron on bronze' or 						 
					player_input == 'use iron to open bronze box' or 
					player_input == 'use iron to open bronze' or 	
					player_input == 'use iron to unlock bronze' or
					player_input == 'use iron to unlock bronze box' or 						
					player_input == 'open bronze box with iron' or 
					player_input == 'open bronze with iron' or 				
					player_input == 'open bronze box using iron' or 
					player_input == 'open bronze using iron' or 				
					player_input == 'unlock bronze box using iron' or 
					player_input == 'unlock bronze using iron' or 						
					player_input == 'unlock bronze box with iron' or 			
					player_input == 'unlock bronze with iron' or
					player_input == 'unlock bronze box with iron'):

					print("What iron?")
				
			return()								
								
		# OPEN BRONZE BOX
		if (player_input == 'open bronze box' or 
			player_input == 'open bronze'):

			if (game_states["roomid"] == 2):

				if (game_states["bronzebox"] == 2):
					print("The bronze box is already open.")
								
				if (game_states["bronzebox"] == 1):
					print("You open the bronze box.")
					game_states["bronzebox"] = 2
					game_states["northdoor"] = 0
					game_states["southdoor"] = 0
					game_states["westdoor"] = 1

					if ("aluminum key" not in inventory):
						print("There is an aluminum key inside the bronze box.")
					
					if ("aluminum key" in inventory):
						print("The bronze box is empty.")
								
				if (game_states["bronzebox"] == 0):
					print("The bronze box is securely locked.  You can't open it.")

			if (game_states["roomid"] != 2):

				if (player_input == 'open bronze box'):	
					print("There isn't any bronze box here.")
				
				if (player_input == 'open bronze'):	
					print("There isn't anything bronze in here.")
							
			return()
					
		# CLOSE BLACK BOX
		if (player_input == 'close bronze' or 
			player_input == 'close bronze box'):

			if (game_states["roomid"] == 2):

				if (game_states["bronzebox"] != 2):
					print("The bronze box is already closed.")
								
				if (game_states["bronzebox"] == 2):
					print("You close the bronze box.")
					game_states["bronzebox"] = 1
					game_states["northdoor"] = 0
					game_states["southdoor"] = 0
					game_states["westdoor"] = 0

			if (game_states["roomid"] != 2):

				if (player_input == 'close bronze box'):	
					print("There isn't any bronze box here.")
				
				if (player_input == 'close bronze'):	
					print("There isn't anything bronze in here.")
								
			return()
				
		# TAKE BRONZE BOX
		if (player_input == 'take bronze box' or 
			player_input == 'take bronze'):

			if (game_states["roomid"] == 2):
				print("The bronze box seems to be an integral part of the floor, you can't take it.")
			
			if (game_states["roomid"] != 2):

				if (player_input == 'take bronze box'):	
					print("There isn't any bronze box here.")
				
				if (player_input == 'take bronze'):	
					print("There isn't anything bronze in here.")
							
			return()
				
		# LOOK STEEL BOX
		if (player_input == 'look steel box' or 
			player_input == 'look steel'):

			if (game_states["roomid"] == 5):

				print("It's a box made out of steel.")
				print("There is a keyhole on a side of the steel box.")	

				if (game_states["steelbox"] == 0):
					print("The steel box is currently closed.")
				
				if (game_states["steelbox"] != 0):

					print("The steel box is currently open.")

					if ("batteries" not in inventory):
						print("There are batteries inside the steel box.")
					
					if ("batteries" in inventory):
						print("The steel box is empty.")
			
			if (game_states["roomid"] != 5):

				if (player_input == 'look steel box'):	
					print("There isn't any steel box here.")
						
				if (player_input == 'look steel'):	
					print("There isn't anything steel in here.")
				
			return()			
				
		# UNLOCK STEEL BOX
		if (player_input == 'unlock steel box' or 
			player_input == 'unlock steel'):

			if (game_states["roomid"] == 5):

				if ("aluminum key" in inventory or "brass key" in inventory or "iron key" in inventory):
					print("Please specify which key to use to unlock the steel box.")
				
				if ("aluminum key" not in inventory and "brass key" not in inventory and "iron key" not in inventory):
					print("You don't have any key.")
								
			if (game_states["roomid"] != 5):

				if (player_input == 'unlock steel box'):
					print("There isn't any steel box here.")
				
				if (player_input == 'unlock steel'):
					print("There isn't anything steel in here.")
				
			return()							
				
		# UNLOCK STEEL BOX WITH KEY / OPEN STEEL BOX WITH KEY
		if (player_input == 'use key on steel box' or 
			player_input == 'use key on steel' or 		
			player_input == 'use key to open steel box' or 
			player_input == 'use key to open steel' or 			
			player_input == 'use key to unlock steel box' or 
			player_input == 'use key to unlock steel' or						
			player_input == 'open steel box with key' or 
			player_input == 'open steel box using key' or 
			player_input == 'open steel with key' or 
			player_input == 'open steel using key' or 			
			player_input == 'unlock steel box using key' or 
			player_input == 'unlock steel box with key' or 			
			player_input == 'unlock steel using key' or 
			player_input == 'unlock steel with key'):		

			if (game_states["roomid"] == 5):

				if ("aluminum key" in inventory or 
					"brass key" in inventory or 
					"iron key" in inventory):
					print("Please specify which key to use to unlock the steel box.")

			if (game_states["roomid"] != 5):

				if (player_input == 'use key on steel box' or 
					player_input == 'use key to open steel box' or 
					player_input == 'open steel box with key' or 
					player_input == 'open steel box using key' or 
					player_input == 'unlock steel box using key' or 
					player_input == 'unlock steel box with key' or 			
					player_input == 'use key to unlock steel box'):

					print("There is no steel box here.")
				
				if (player_input == 'use key on steel' or 
					player_input == 'use key to open steel' or 
					player_input == 'open steel with key' or 
					player_input == 'open steel using key' or 
					player_input == 'unlock steel using key' or 
					player_input == 'unlock steel with key' or 			
					player_input == 'use key to unlock steel'):

					print("There isn't anything steel in here.")
				
			if ("aluminum key" not in inventory and "brass key" not in inventory and "iron key" not in inventory):
				print("What key?")
			
			return()						
						
		# UNLOCK STEEL BOX WITH ALUMINUM KEY / OPEN STEEL BOX WITH ALUMINUM KEY
		if (player_input == 'use aluminum key on steel box' or
			player_input == 'use aluminum key on steel' or 
		    player_input == 'use aluminum on steel box' or 				
			player_input == 'use aluminum on steel' or 							 
			player_input == 'use aluminum key to open steel box' or 
			player_input == 'use aluminum key to open steel' or 
			player_input == 'use aluminum to open steel box' or 
			player_input == 'use aluminum to open steel' or 			
			player_input == 'use aluminum key to unlock steel' or
			player_input == 'use aluminum key to unlock steel box' or 
			player_input == 'use aluminum to unlock steel' or
			player_input == 'use aluminum to unlock steel box' or 						
			player_input == 'open steel box with aluminum key' or 
			player_input == 'open steel with aluminum key' or 	
			player_input == 'open steel box with aluminum' or 
			player_input == 'open steel with aluminum' or 					
			player_input == 'open steel box using aluminum key' or 
			player_input == 'open steel using aluminum key' or 
			player_input == 'open steel box using aluminum' or 
			player_input == 'open steel using aluminum' or 					
			player_input == 'unlock steel box using aluminum key' or 
			player_input == 'unlock steel using aluminum key' or 
			player_input == 'unlock steel box using aluminum' or 
			player_input == 'unlock steel using aluminum' or 							
			player_input == 'unlock steel box with aluminum key' or 			
			player_input == 'unlock steel with aluminum key' or
			player_input == 'unlock steel box with aluminum' or 			
			player_input == 'unlock steel with aluminum'):	

			if (game_states["roomid"] == 5 and 
				"aluminum key" in inventory):

				if (game_states["steelbox"] != 0):
					print("The steel box is already open.")	

				if (game_states["steelbox"] == 0):
					print("You insert the aluminum key into the keyhole on the steel box.")
					print("The key fits.  After turning the key, the steel box automatically opens.")
					print("You take the aluminum key out of the keyhole.")				
					game_states["steelbox"] = 1
				
				if ("batteries" not in inventory):
					print("There are batteries inside the steel box.")
				
				if ("batteries" in inventory):
					print("The steel box is empty.")
				
			if (game_states["roomid"] != 5):	

				if (player_input == 'use aluminum key on steel box' or
					player_input == 'use aluminum on steel box' or 									 
					player_input == 'use aluminum key to open steel box' or 
					player_input == 'use aluminum to open steel box' or 	
					player_input == 'use aluminum key to unlock steel box' or 
					player_input == 'use aluminum to unlock steel box' or 						
					player_input == 'open steel box with aluminum key' or 	
					player_input == 'open steel box with aluminum' or 				
					player_input == 'open steel box using aluminum key' or 
					player_input == 'open steel box using aluminum' or 			
					player_input == 'unlock steel box using aluminum key' or 
					player_input == 'unlock steel box using aluminum' or 					
					player_input == 'unlock steel box with aluminum key' or 			
					player_input == 'unlock steel box with aluminum'):

					print("There is no steel box here.")
				
				if (player_input == 'use aluminum key on steel' or
					player_input == 'use aluminum on steel' or 									 
					player_input == 'use aluminum key to open steel' or 
					player_input == 'use aluminum to open steel' or 	
					player_input == 'use aluminum key to unlock steel' or 
					player_input == 'use aluminum to unlock steel' or 						
					player_input == 'open steel with aluminum key' or 	
					player_input == 'open steel with aluminum' or 				
					player_input == 'open steel using aluminum key' or 
					player_input == 'open steel using aluminum' or 			
					player_input == 'unlock steel using aluminum key' or 
					player_input == 'unlock steel using aluminum' or 					
					player_input == 'unlock steel with aluminum key' or 			
					player_input == 'unlock steel with aluminum'):

					print("There isn't anything steel in here.")
					
			if ("aluminum key" not in inventory):

				if (player_input == 'use aluminum key on steel box' or
					player_input == 'use aluminum key on steel' or 						 
					player_input == 'use aluminum key to open steel box' or 
					player_input == 'use aluminum key to open steel' or 	
					player_input == 'use aluminum key to unlock steel' or
					player_input == 'use aluminum key to unlock steel box' or 						
					player_input == 'open steel box with aluminum key' or 
					player_input == 'open steel with aluminum key' or 				
					player_input == 'open steel box using aluminum key' or 
					player_input == 'open steel using aluminum key' or 				
					player_input == 'unlock steel box using aluminum key' or 
					player_input == 'unlock steel using aluminum key' or 						
					player_input == 'unlock steel box with aluminum key' or 			
					player_input == 'unlock steel with aluminum key'):

					print("What aluminum key?")
				
				if (player_input == 'use aluminum on steel box' or
					player_input == 'use aluminum on steel' or 						 
					player_input == 'use aluminum to open steel box' or 
					player_input == 'use aluminum to open steel' or 	
					player_input == 'use aluminum to unlock steel' or
					player_input == 'use aluminum to unlock steel box' or 						
					player_input == 'open steel box with aluminum' or 
					player_input == 'open steel with aluminum' or 				
					player_input == 'open steel box using aluminum' or 
					player_input == 'open steel using aluminum' or 				
					player_input == 'unlock steel box using aluminum' or 
					player_input == 'unlock steel using aluminum' or 						
					player_input == 'unlock steel box with aluminum' or 			
					player_input == 'unlock steel with aluminum'):

					print("What aluminum?")
					
			return()								
						

		# UNLOCK STEEL BOX WITH BRASS KEY / OPEN STEEL BOX WITH BRASS KEY
		if (player_input == 'use brass key on steel box' or
			player_input == 'use brass key on steel' or 
		    player_input == 'use brass on steel box' or 				
			player_input == 'use brass on steel' or 							 
			player_input == 'use brass key to open steel box' or 
			player_input == 'use brass key to open steel' or 
			player_input == 'use brass to open steel box' or 
			player_input == 'use brass to open steel' or 			
			player_input == 'use brass key to unlock steel' or
			player_input == 'use brass key to unlock steel box' or 
			player_input == 'use brass to unlock steel' or
			player_input == 'use brass to unlock steel box' or 						
			player_input == 'open steel box with brass key' or 
			player_input == 'open steel with brass key' or 	
			player_input == 'open steel box with brass' or 
			player_input == 'open steel with brass' or 					
			player_input == 'open steel box using brass key' or 
			player_input == 'open steel using brass key' or 
			player_input == 'open steel box using brass' or 
			player_input == 'open steel using brass' or 					
			player_input == 'unlock steel box using brass key' or 
			player_input == 'unlock steel using brass key' or 
			player_input == 'unlock steel box using brass' or 
			player_input == 'unlock steel using brass' or 							
			player_input == 'unlock steel box with brass key' or 			
			player_input == 'unlock steel with brass key' or
			player_input == 'unlock steel box with brass' or 			
			player_input == 'unlock steel with brass'):

			if (game_states["roomid"] == 5 and 
				"brass key" in inventory):
				print("You attempted to use brass key to unlock the steel box, but the brass key doens't fit in the keyhole.")
			
			if (game_states["roomid"] != 5):	

				if (player_input == 'use brass key on steel box' or
					player_input == 'use brass on steel box' or 									 
					player_input == 'use brass key to open steel box' or 
					player_input == 'use brass to open steel box' or 	
					player_input == 'use brass key to unlock steel box' or 
					player_input == 'use brass to unlock steel box' or 						
					player_input == 'open steel box with brass key' or 	
					player_input == 'open steel box with brass' or 				
					player_input == 'open steel box using brass key' or 
					player_input == 'open steel box using brass' or 			
					player_input == 'unlock steel box using brass key' or 
					player_input == 'unlock steel box using brass' or 					
					player_input == 'unlock steel box with brass key' or 			
					player_input == 'unlock steel box with brass'):

					print("There is no steel box here.")
				
				if (player_input == 'use brass key on steel' or
					player_input == 'use brass on steel' or 									 
					player_input == 'use brass key to open steel' or 
					player_input == 'use brass to open steel' or 	
					player_input == 'use brass key to unlock steel' or 
					player_input == 'use brass to unlock steel' or 						
					player_input == 'open steel with brass key' or 	
					player_input == 'open steel with brass' or 				
					player_input == 'open steel using brass key' or 
					player_input == 'open steel using brass' or 			
					player_input == 'unlock steel using brass key' or 
					player_input == 'unlock steel using brass' or 					
					player_input == 'unlock steel with brass key' or 			
					player_input == 'unlock steel with brass'):

					print("There isn't anything steel in here.")
					
			if ("brass key" not in inventory):

				if (player_input == 'use brass key on steel box' or
					player_input == 'use brass key on steel' or 						 
					player_input == 'use brass key to open steel box' or 
					player_input == 'use brass key to open steel' or 	
					player_input == 'use brass key to unlock steel' or
					player_input == 'use brass key to unlock steel box' or 						
					player_input == 'open steel box with brass key' or 
					player_input == 'open steel with brass key' or 				
					player_input == 'open steel box using brass key' or 
					player_input == 'open steel using brass key' or 				
					player_input == 'unlock steel box using brass key' or 
					player_input == 'unlock steel using brass key' or 						
					player_input == 'unlock steel box with brass key' or 			
					player_input == 'unlock steel with brass key'):

					print("What brass key?")
				
				if (player_input == 'use brass on steel box' or
					player_input == 'use brass on steel' or 						 
					player_input == 'use brass to open steel box' or 
					player_input == 'use brass to open steel' or 	
					player_input == 'use brass to unlock steel' or
					player_input == 'use brass to unlock steel box' or 						
					player_input == 'open steel box with brass' or 
					player_input == 'open steel with brass' or 				
					player_input == 'open steel box using brass' or 
					player_input == 'open steel using brass' or 				
					player_input == 'unlock steel box using brass' or 
					player_input == 'unlock steel using brass' or 						
					player_input == 'unlock steel box with brass' or 			
					player_input == 'unlock steel with brass' or
					player_input == 'unlock steel box with brass'):

					print("What brass?")
					
			return()								
						
		# UNLOCK STEEL BOX WITH IRON KEY / OPEN STEEL BOX WITH IRON KEY
		if (player_input == 'use iron key on steel box' or
			player_input == 'use iron key on steel' or 
		    player_input == 'use iron on steel box' or 				
			player_input == 'use iron on steel' or 							 
			player_input == 'use iron key to open steel box' or 
			player_input == 'use iron key to open steel' or 
			player_input == 'use iron to open steel box' or 
			player_input == 'use iron to open steel' or 			
			player_input == 'use iron key to unlock steel' or
			player_input == 'use iron key to unlock steel box' or 
			player_input == 'use iron to unlock steel' or
			player_input == 'use iron to unlock steel box' or 						
			player_input == 'open steel box with iron key' or 
			player_input == 'open steel with iron key' or 	
			player_input == 'open steel box with iron' or 
			player_input == 'open steel with iron' or 					
			player_input == 'open steel box using iron key' or 
			player_input == 'open steel using iron key' or 
			player_input == 'open steel box using iron' or 
			player_input == 'open steel using iron' or 					
			player_input == 'unlock steel box using iron key' or 
			player_input == 'unlock steel using iron key' or 
			player_input == 'unlock steel box using iron' or 
			player_input == 'unlock steel using iron' or 							
			player_input == 'unlock steel box with iron key' or 			
			player_input == 'unlock steel with iron key' or
			player_input == 'unlock steel box with iron' or 			
			player_input == 'unlock steel with iron'):	

			if (game_states["roomid"] == 5 and 
				"iron key" in inventory):
				print("You attempted to use iron key to open the steel box, but the iron key doens't fit in the keyhole.")
			
			if (game_states["roomid"] != 5):	

				if (player_input == 'use iron key on steel box' or
					player_input == 'use iron on steel box' or 									 
					player_input == 'use iron key to open steel box' or 
					player_input == 'use iron to open steel box' or 	
					player_input == 'use iron key to unlock steel box' or 
					player_input == 'use iron to unlock steel box' or 						
					player_input == 'open steel box with iron key' or 	
					player_input == 'open steel box with iron' or 				
					player_input == 'open steel box using iron key' or 
					player_input == 'open steel box using iron' or 			
					player_input == 'unlock steel box using iron key' or 
					player_input == 'unlock steel box using iron' or 					
					player_input == 'unlock steel box with iron key' or 			
					player_input == 'unlock steel box with iron'):

					print("There is no steel box here.")
				
				if (player_input == 'use iron key on steel' or
					player_input == 'use iron on steel' or 									 
					player_input == 'use iron key to open steel' or 
					player_input == 'use iron to open steel' or 	
					player_input == 'use iron key to unlock steel' or 
					player_input == 'use iron to unlock steel' or 						
					player_input == 'open steel with iron key' or 	
					player_input == 'open steel with iron' or 				
					player_input == 'open steel using iron key' or 
					player_input == 'open steel using iron' or 			
					player_input == 'unlock steel using iron key' or 
					player_input == 'unlock steel using iron' or 					
					player_input == 'unlock steel with iron key' or 			
					player_input == 'unlock steel with iron'):

					print("There isn't anything steel in here.")
					
			if ("iron key" not in inventory):

				if (player_input == 'use iron key on steel box' or
					player_input == 'use iron key on steel' or 						 
					player_input == 'use iron key to open steel box' or 
					player_input == 'use iron key to open steel' or 	
					player_input == 'use iron key to unlock steel' or
					player_input == 'use iron key to unlock steel box' or 						
					player_input == 'open steel box with iron key' or 
					player_input == 'open steel with iron key' or 				
					player_input == 'open steel box using iron key' or 
					player_input == 'open steel using iron key' or 				
					player_input == 'unlock steel box using iron key' or 
					player_input == 'unlock steel using iron key' or 						
					player_input == 'unlock steel box with iron key' or 			
					player_input == 'unlock steel with iron key'):

					print("What iron key?")
				
				if (player_input == 'use iron on steel box' or
					player_input == 'use iron on steel' or 						 
					player_input == 'use iron to open steel box' or 
					player_input == 'use iron to open steel' or 	
					player_input == 'use iron to unlock steel' or
					player_input == 'use iron to unlock steel box' or 						
					player_input == 'open steel box with iron' or 
					player_input == 'open steel with iron' or 				
					player_input == 'open steel box using iron' or 
					player_input == 'open steel using iron' or 				
					player_input == 'unlock steel box using iron' or 
					player_input == 'unlock steel using iron' or 						
					player_input == 'unlock steel box with iron' or 			
					player_input == 'unlock steel with iron' or
					player_input == 'unlock steel box with iron'):

					print("What iron?")

			return()								
								
		# OPEN STEEL BOX
		if (player_input == 'open steel box' or 
			player_input == 'open steel'):	

			if (game_states["roomid"] == 5):

				if (game_states["steelbox"] == 0):
					print("You can't open the steel box.")
					print("You will need to unlock the steel box with a key.")
				
				if (game_states["steelbox"] != 0):
					print("The steel box is already open.")

					if ("batteries" not in inventory):
						print("There are batteries inside the steel box.")
					

					if ("batteries" in inventory):
						print("The steel box is empty.")
										
			if (game_states["roomid"] != 5):

				if (player_input == 'open steel box'):	
					print("There isn't any steel box here.")
				

				if (player_input == 'open steel'):	
					print("There isn't anything steel in here.")
							
			return()
									
		# CLOSE STEEL BOX
		if (player_input == 'close steel box' or 
			player_input == 'close steel'):

			if (game_states["roomid"] == 5):

				if (game_states["steelbox"] == 0):
					print("The steel box is already closed.")
				
				if (game_states["steelbox"] != 0):
					print("You close the steel box.")				
					game_states["steelbox"] = 0			
							
			if (game_states["roomid"] != 5):

				if (player_input == 'close steel box'):	
					print("There isn't any steel box here.")
				
				if (player_input == 'close steel'):	
					print("There isn't anyything steel here.")

			return()					
				
		# TAKE STEEL BOX
		if (player_input == 'take steel box' or 
			player_input == 'take steel'):

			if (game_states["roomid"] == 5):
				print("The steel box is too heavy to lift, you can't take it.")
			
			if (game_states["roomid"] != 5):

				if (player_input == 'take steel box'):	
					print("There isn't any steel box here.")
				
				if (player_input == 'take steel'):	
					print("There isn't anyything steel here.")

			return()
					
		# LOOK TITANIUM BOX
		if (player_input == 'look titanium box' or 
			player_input == 'look titanium'):

			if (game_states["roomid"] == 3):

				print("It's a box made out of titanium.")
				print("There is a keyhole on a side of the titanium box.")	

				if (game_states["titaniumbox"] == 0):
					print("The titanium box is currently closed.")
				
				if (game_states["titaniumbox"] != 0):
					print("The titanium box is currently open.")

					if ("iron key" not in inventory):
						print("There is a iron key inside the titanium box.")
					
					if ("iron key" in inventory):
						print("The titanium box is empty.")
					
			if (game_states["roomid"] != 3):

				if (player_input == 'look titanium box'):
					print("There isn't any titanium box here.")
				
				if (player_input == 'look titanium'):
					print("There isn't anything titanium in here.")
								
			return()			
					
		# UNLOCK TITANIUM BOX / UNLOCK TITANIUM BOX WITH KEY
		if (player_input == 'unlock titanium box' or 
			player_input == 'unlock titanium' or 
			player_input == 'unlock titanium with key' or 
			player_input == 'unlock titanium using key' or 
			player_input == 'unlock titanium box with key' or 
			player_input == 'unlock titanium box using key' or 			
			player_input == 'use key to unlock titanium box' or 
			player_input == 'use key on titanium box' or 
			player_input == 'use key to unlock titanium' or 
			player_input == 'use key on titanium'):

			if (game_states["roomid"] == 3 and 
				("aluminum key" in inventory or 
				"brass key" in inventory or 
				"iron key" in inventory)):
				print("Please specify which key to use to unlock the titanium box.")
						
			if (game_states["roomid"] != 3):

				if (player_input == 'unlock titanium box' or 
					player_input == 'unlock titanium box with key' or 
					player_input == 'unlock titanium box using key' or 
					player_input == 'use key to unlock titanium box' or 
					player_input == 'use key on titanium box'):

					print("There isn't any titanium box here.")
				
				if (player_input == 'unlock titanium' or 
					player_input == 'unlock titanium with key' or 
					player_input == 'unlock titanium using key' or 
					player_input == 'use key to unlock titanium' or 
					player_input == 'use key on titanium'):

					print("There isn't anything titanium in here.")
				
				if ("aluminum key" not in inventory and "brass key" not in inventory and "iron key" not in inventory):
					print("You don't have any key.")

			return()					
		
		# UNLOCK TITANIUM BOX WITH ALUMINUM KEY / OPEN TITANIUM BOX WITH ALUMINUM KEY
		if (player_input == 'use aluminum key on titanium box' or
			player_input == 'use aluminum key on titanium' or 
		    player_input == 'use aluminum on titanium box' or 				
			player_input == 'use aluminum on titanium' or 							 
			player_input == 'use aluminum key to open titanium box' or 
			player_input == 'use aluminum key to open titanium' or 
			player_input == 'use aluminum to open titanium box' or 
			player_input == 'use aluminum to open titanium' or 			
			player_input == 'use aluminum key to unlock titanium' or
			player_input == 'use aluminum key to unlock titanium box' or 
			player_input == 'use aluminum to unlock titanium' or
			player_input == 'use aluminum to unlock titanium box' or 						
			player_input == 'open titanium box with aluminum key' or 
			player_input == 'open titanium with aluminum key' or 	
			player_input == 'open titanium box with aluminum' or 
			player_input == 'open titanium with aluminum' or 					
			player_input == 'open titanium box using aluminum key' or 
			player_input == 'open titanium using aluminum key' or 
			player_input == 'open titanium box using aluminum' or 
			player_input == 'open titanium using aluminum' or 					
			player_input == 'unlock titanium box using aluminum key' or 
			player_input == 'unlock titanium using aluminum key' or 
			player_input == 'unlock titanium box using aluminum' or 
			player_input == 'unlock titanium using aluminum' or 							
			player_input == 'unlock titanium box with aluminum key' or 			
			player_input == 'unlock titanium with aluminum key' or
			player_input == 'unlock titanium box with aluminum' or 			
			player_input == 'unlock titanium with aluminum'):

			if (game_states["roomid"] == 3 and 
				"aluminum key" in inventory):
				print("You attempted to use aluminum key to unlock the titanium box, but the aluminum key doens't fit in the keyhole.")
			
			if (game_states["roomid"] != 3):	

				if (player_input == 'use aluminum key on titanium box' or
					player_input == 'use aluminum on titanium box' or 									 
					player_input == 'use aluminum key to open titanium box' or 
					player_input == 'use aluminum to open titanium box' or 	
					player_input == 'use aluminum key to unlock titanium box' or 
					player_input == 'use aluminum to unlock titanium box' or 						
					player_input == 'open titanium box with aluminum key' or 	
					player_input == 'open titanium box with aluminum' or 				
					player_input == 'open titanium box using aluminum key' or 
					player_input == 'open titanium box using aluminum' or 			
					player_input == 'unlock titanium box using aluminum key' or 
					player_input == 'unlock titanium box using aluminum' or 					
					player_input == 'unlock titanium box with aluminum key' or 			
					player_input == 'unlock titanium box with aluminum'):

					print("There is no titanium box here.")

				if (player_input == 'use aluminum key on titanium' or
					player_input == 'use aluminum on titanium' or 									 
					player_input == 'use aluminum key to open titanium' or 
					player_input == 'use aluminum to open titanium' or 	
					player_input == 'use aluminum key to unlock titanium' or 
					player_input == 'use aluminum to unlock titanium' or 						
					player_input == 'open titanium with aluminum key' or 	
					player_input == 'open titanium with aluminum' or 				
					player_input == 'open titanium using aluminum key' or 
					player_input == 'open titanium using aluminum' or 			
					player_input == 'unlock titanium using aluminum key' or 
					player_input == 'unlock titanium using aluminum' or 					
					player_input == 'unlock titanium with aluminum key' or 			
					player_input == 'unlock titanium with aluminum'):

					print("There isn't anything titanium in here.")

			if ("aluminum key" not in inventory):

				if (player_input == 'use aluminum key on titanium box' or
					player_input == 'use aluminum key on titanium' or 						 
					player_input == 'use aluminum key to open titanium box' or 
					player_input == 'use aluminum key to open titanium' or 	
					player_input == 'use aluminum key to unlock titanium' or
					player_input == 'use aluminum key to unlock titanium box' or 						
					player_input == 'open titanium box with aluminum key' or 
					player_input == 'open titanium with aluminum key' or 				
					player_input == 'open titanium box using aluminum key' or 
					player_input == 'open titanium using aluminum key' or 				
					player_input == 'unlock titanium box using aluminum key' or 
					player_input == 'unlock titanium using aluminum key' or 						
					player_input == 'unlock titanium box with aluminum key' or 			
					player_input == 'unlock titanium with aluminum key'):

					print("What aluminum key?")
				
				if (player_input == 'use aluminum on titanium box' or
					player_input == 'use aluminum on titanium' or 						 
					player_input == 'use aluminum to open titanium box' or 
					player_input == 'use aluminum to open titanium' or 	
					player_input == 'use aluminum to unlock titanium' or
					player_input == 'use aluminum to unlock titanium box' or 						
					player_input == 'open titanium box with aluminum' or 
					player_input == 'open titanium with aluminum' or 				
					player_input == 'open titanium box using aluminum' or 
					player_input == 'open titanium using aluminum' or 				
					player_input == 'unlock titanium box using aluminum' or 
					player_input == 'unlock titanium using aluminum' or 						
					player_input == 'unlock titanium box with aluminum' or 			
					player_input == 'unlock titanium with aluminum' or
					player_input == 'unlock titanium box with aluminum'):

					print("What aluminum?")

			return()								
						
		# UNLOCK TITANIUM BOX WITH BRASS KEY / OPEN TITANIUM BOX WITH BRASS KEY
		if (player_input == 'use brass key on titanium box' or
			player_input == 'use brass key on titanium' or 
		    player_input == 'use brass on titanium box' or 				
			player_input == 'use brass on titanium' or 							 
			player_input == 'use brass key to open titanium box' or 
			player_input == 'use brass key to open titanium' or 
			player_input == 'use brass to open titanium box' or 
			player_input == 'use brass to open titanium' or 			
			player_input == 'use brass key to unlock titanium' or
			player_input == 'use brass key to unlock titanium box' or 
			player_input == 'use brass to unlock titanium' or
			player_input == 'use brass to unlock titanium box' or 						
			player_input == 'open titanium box with brass key' or 
			player_input == 'open titanium with brass key' or 	
			player_input == 'open titanium box with brass' or 
			player_input == 'open titanium with brass' or 					
			player_input == 'open titanium box using brass key' or 
			player_input == 'open titanium using brass key' or 
			player_input == 'open titanium box using brass' or 
			player_input == 'open titanium using brass' or 					
			player_input == 'unlock titanium box using brass key' or 
			player_input == 'unlock titanium using brass key' or 
			player_input == 'unlock titanium box using brass' or 
			player_input == 'unlock titanium using brass' or 							
			player_input == 'unlock titanium box with brass key' or 			
			player_input == 'unlock titanium with brass key' or
			player_input == 'unlock titanium box with brass' or 			
			player_input == 'unlock titanium with brass'):	

			if (game_states["roomid"] == 3 and "brass key" in inventory):

				if (game_states["titaniumbox"] != 0):
					print("The titanium box is already open.")	

				if (game_states["titaniumbox"] == 0):
					print("You insert the brass key into the keyhole on the titanium box.")
					print("The key fits.  After turning the key, the titanium box automatically opens.")
					print("You take the brass key out of the keyhole.")				
					game_states["titaniumbox"] = 1
				
				if ("iron key" not in inventory):
					print("There is an iron key inside the titanium box.")
				
				if ("iron key" in inventory):
					print("The titanium box is empty.")
					
			if (game_states["roomid"] != 3):	
				if (player_input == 'use brass key on titanium box' or
					player_input == 'use brass on titanium box' or 									 
					player_input == 'use brass key to open titanium box' or 
					player_input == 'use brass to open titanium box' or 	
					player_input == 'use brass key to unlock titanium box' or 
					player_input == 'use brass to unlock titanium box' or 						
					player_input == 'open titanium box with brass key' or 	
					player_input == 'open titanium box with brass' or 				
					player_input == 'open titanium box using brass key' or 
					player_input == 'open titanium box using brass' or 			
					player_input == 'unlock titanium box using brass key' or 
					player_input == 'unlock titanium box using brass' or 					
					player_input == 'unlock titanium box with brass key' or 			
					player_input == 'unlock titanium box with brass'):

					print("There is no titanium box here.")
				
				if (player_input == 'use brass key on titanium' or
					player_input == 'use brass on titanium' or 									 
					player_input == 'use brass key to open titanium' or 
					player_input == 'use brass to open titanium' or 	
					player_input == 'use brass key to unlock titanium' or 
					player_input == 'use brass to unlock titanium' or 						
					player_input == 'open titanium with brass key' or 	
					player_input == 'open titanium with brass' or 				
					player_input == 'open titanium using brass key' or 
					player_input == 'open titanium using brass' or 			
					player_input == 'unlock titanium using brass key' or 
					player_input == 'unlock titanium using brass' or 					
					player_input == 'unlock titanium with brass key' or 			
					player_input == 'unlock titanium with brass'):

					print("There isn't anything titanium in here.")
					
			if ("brass key" not in inventory):

				if (player_input == 'use brass key on titanium box' or
					player_input == 'use brass key on titanium' or 						 
					player_input == 'use brass key to open titanium box' or 
					player_input == 'use brass key to open titanium' or 	
					player_input == 'use brass key to unlock titanium' or
					player_input == 'use brass key to unlock titanium box' or 						
					player_input == 'open titanium box with brass key' or 
					player_input == 'open titanium with brass key' or 				
					player_input == 'open titanium box using brass key' or 
					player_input == 'open titanium using brass key' or 				
					player_input == 'unlock titanium box using brass key' or 
					player_input == 'unlock titanium using brass key' or 						
					player_input == 'unlock titanium box with brass key' or 			
					player_input == 'unlock titanium with brass key'):

					print("What brass key?")
				
				if (player_input == 'use brass on titanium box' or
					player_input == 'use brass on titanium' or 						 
					player_input == 'use brass to open titanium box' or 
					player_input == 'use brass to open titanium' or 	
					player_input == 'use brass to unlock titanium' or
					player_input == 'use brass to unlock titanium box' or 						
					player_input == 'open titanium box with brass' or 
					player_input == 'open titanium with brass' or 				
					player_input == 'open titanium box using brass' or 
					player_input == 'open titanium using brass' or 				
					player_input == 'unlock titanium box using brass' or 
					player_input == 'unlock titanium using brass' or 						
					player_input == 'unlock titanium box with brass' or 			
					player_input == 'unlock titanium with brass' or
					player_input == 'unlock titanium box with brass'):

					print("What brass?")
					
			return()								
							
		# UNLOCK TITANIUM BOX WITH IRON KEY / OPEN TITANIUM BOX WITH IRON KEY
		if (player_input == 'use iron key on titanium box' or
			player_input == 'use iron key on titanium' or 
		    player_input == 'use iron on titanium box' or 				
			player_input == 'use iron on titanium' or 							 
			player_input == 'use iron key to open titanium box' or 
			player_input == 'use iron key to open titanium' or 
			player_input == 'use iron to open titanium box' or 
			player_input == 'use iron to open titanium' or 			
			player_input == 'use iron key to unlock titanium' or
			player_input == 'use iron key to unlock titanium box' or 
			player_input == 'use iron to unlock titanium' or
			player_input == 'use iron to unlock titanium box' or 						
			player_input == 'open titanium box with iron key' or 
			player_input == 'open titanium with iron key' or 	
			player_input == 'open titanium box with iron' or 
			player_input == 'open titanium with iron' or 					
			player_input == 'open titanium box using iron key' or 
			player_input == 'open titanium using iron key' or 
			player_input == 'open titanium box using iron' or 
			player_input == 'open titanium using iron' or 					
			player_input == 'unlock titanium box using iron key' or 
			player_input == 'unlock titanium using iron key' or 
			player_input == 'unlock titanium box using iron' or 
			player_input == 'unlock titanium using iron' or 							
			player_input == 'unlock titanium box with iron key' or 			
			player_input == 'unlock titanium with iron key' or
			player_input == 'unlock titanium box with iron' or 			
			player_input == 'unlock titanium with iron'):	

			if (game_states["roomid"] == 3 and 
				"iron key" in inventory):
				print("You attempted to use iron key to unlock the titanium box, but the iron key doens't fit in the keyhole.")
			
			if (game_states["roomid"] != 3):	

				if (player_input == 'use iron key on titanium box' or
					player_input == 'use iron on titanium box' or 									 
					player_input == 'use iron key to open titanium box' or 
					player_input == 'use iron to open titanium box' or 	
					player_input == 'use iron key to unlock titanium box' or 
					player_input == 'use iron to unlock titanium box' or 						
					player_input == 'open titanium box with iron key' or 	
					player_input == 'open titanium box with iron' or 				
					player_input == 'open titanium box using iron key' or 
					player_input == 'open titanium box using iron' or 			
					player_input == 'unlock titanium box using iron key' or 
					player_input == 'unlock titanium box using iron' or 					
					player_input == 'unlock titanium box with iron key' or 			
					player_input == 'unlock titanium box with iron'):

					print("There is no titanium box here.")
				
				if (player_input == 'use iron key on titanium' or
					player_input == 'use iron on titanium' or 									 
					player_input == 'use iron key to open titanium' or 
					player_input == 'use iron to open titanium' or 	
					player_input == 'use iron key to unlock titanium' or 
					player_input == 'use iron to unlock titanium' or 						
					player_input == 'open titanium with iron key' or 	
					player_input == 'open titanium with iron' or 				
					player_input == 'open titanium using iron key' or 
					player_input == 'open titanium using iron' or 			
					player_input == 'unlock titanium using iron key' or 
					player_input == 'unlock titanium using iron' or 					
					player_input == 'unlock titanium with iron key' or 			
					player_input == 'unlock titanium with iron'):

					print("There isn't anything titanium in here.")

			if ("iron key" not in inventory):

				if (player_input == 'use iron key on titanium box' or
					player_input == 'use iron key on titanium' or 						 
					player_input == 'use iron key to open titanium box' or 
					player_input == 'use iron key to open titanium' or 	
					player_input == 'use iron key to unlock titanium' or
					player_input == 'use iron key to unlock titanium box' or 						
					player_input == 'open titanium box with iron key' or 
					player_input == 'open titanium with iron key' or 				
					player_input == 'open titanium box using iron key' or 
					player_input == 'open titanium using iron key' or 				
					player_input == 'unlock titanium box using iron key' or 
					player_input == 'unlock titanium using iron key' or 						
					player_input == 'unlock titanium box with iron key' or 			
					player_input == 'unlock titanium with iron key'):

					print("What iron key?")
				
				if (player_input == 'use iron on titanium box' or
					player_input == 'use iron on titanium' or 						 
					player_input == 'use iron to open titanium box' or 
					player_input == 'use iron to open titanium' or 	
					player_input == 'use iron to unlock titanium' or
					player_input == 'use iron to unlock titanium box' or 						
					player_input == 'open titanium box with iron' or 
					player_input == 'open titanium with iron' or 				
					player_input == 'open titanium box using iron' or 
					player_input == 'open titanium using iron' or 				
					player_input == 'unlock titanium box using iron' or 
					player_input == 'unlock titanium using iron' or 						
					player_input == 'unlock titanium box with iron' or 			
					player_input == 'unlock titanium with iron' or
					player_input == 'unlock titanium box with iron'):

					print("What iron?")
					
			return()								
				
		# OPEN TITANIUM BOX
		if (player_input == 'open titanium box' or 
			player_input == 'open titanium'):	

			if (game_states["roomid"] == 3):

				if (game_states["titaniumbox"] == 0):
					print("You can't open the titanium box.")
					print("You will need to unlock the titanium box with a key.")

				if (game_states["titaniumbox"] != 0):
					print("The titanium box is already open.")

					if ("iron key" not in inventory):
						print("There is a iron key inside the titanium box.")
					
					if ("iron key" in inventory):
						print("The titanium box is empty.")
									
			if (game_states["roomid"] != 3):

				if (player_input == 'open titanium box'):
					print("There isn't any titanium box here.")
				
				if (player_input == 'open titanium'):
					print("There isn't anything titanium in here.")
							
			return()
							
		# CLOSE TITANIUM BOX
		if (player_input == 'close titanium box' or 
			player_input == 'close titanium'):		

			if (game_states["roomid"] == 3):

				if (game_states["titaniumbox"] == 0):
					print("The titanium box is already closed.")
				
				if (game_states["titaniumbox"] != 0):
					print("You close the titanium box.")				
					game_states["titaniumbox"] = 0
								
			if (game_states["roomid"] != 3):

				if (player_input == 'close titanium box'):
					print("There isn't any titanium box here.")
				
				if (player_input == 'close titanium'):
					print("There isn't anything titanium in here.")
							
			return()				
						
		# TAKE TITANIUM BOX
		if (player_input == 'take titanium box' or 
			player_input == 'take titanium'):

			if (game_states["roomid"] == 3):
				print("The titanium box seems to be fused to the floor, you can't take it.")
			
			if (game_states["roomid"] != 3):

				if (player_input == 'take titanium box'):
					print("There isn't any titanium box here.")
				
				if (player_input == 'take titanium'):
					print("There isn't anything titanium in here.")
							
			return()
		
		# LOOK METAL ACCESS PANEL
		if (player_input == 'look access panel' or 
			player_input == 'look panel' or 	
			player_input == 'look access' or 	
			player_input == 'look metal access' or 
			player_input == 'look metal panel' or 													
			player_input == 'look metal access panel'):

				if (game_states["roomid"] == 1 or
					game_states["roomid"] == 2 or 
					game_states["roomid"] == 3):

					if (player_input == 'look access panel'):
						print("There isn't any access panel here.")
					
					if (player_input == 'look panel'):
						print("There isn't any panel here.")

					if (player_input == 'look access'):
						print("What access?")
					 			
					if (player_input == 'look metal access'):
						print("What metal access?")
					 			
					if (player_input == 'look metal access panel'):
						print("There isn't any metal access panel here.")
					
					if (player_input == 'look metal panel'):
						print("There isn't any metal panel here.")
										
				if (game_states["roomid"] == 4):

					if (game_states["southaccesspanel"] != 0):
						print("It's a metal access panel. It's currently open.")
						print("You can see red and blue switches in the access panel.")
					
					if (game_states["southaccesspanel"] == 0):
						print("It's a metal access panel. It's currently closed.")
										
				if (game_states["roomid"] == 5):

					if (game_states["northaccesspanel"] != 0):
						print("It's a metal access panel. It's currently open.")
						print("You can see black and white switches in the access panel.")
					
					if (game_states["northaccesspanel"] == 0):
						print("It's a metal access panel. It's currently closed.")
					
				return()		
								
		# OPEN METAL ACCESS PANEL
		if (player_input == 'open access panel' or 
			player_input == 'open panel' or 	
			player_input == 'open access' or 	
			player_input == 'open metal access' or 
			player_input == 'open metal panel' or 													
			player_input == 'open metal access panel'):

				if (game_states["roomid"] == 1 or 
					game_states["roomid"] == 2 or 
					game_states["roomid"] == 3):

					if (player_input == 'open access panel'):
						print("There isn't any access panel here.")
					
					if (player_input == 'open panel'):
						print("There isn't any panel here.")
						
					if (player_input == 'open access'):
						print("What access?")
					 			
					if (player_input == 'open metal access'):
						print("What metal access?")
					 				
					if (player_input == 'open metal access panel'):
						print("There isn't any metal access panel here.")
					
					if (player_input == 'open metal panel'):
						print("There isn't any metal panel here.")
										
				if (game_states["roomid"] == 4):

					if (game_states["southaccesspanel"] == 2):
						print("It's already open.")
									
					if (game_states["southaccesspanel"] == 1):
						game_states["southaccesspanel"] = 2
						game_states["southdoor"] = 0
						print("Opening the metal access panel reveals two switches.")
						print("You can see a red switch here.")
						print("You can see a blue switch here.")		
						print("The light above the door in the north is now red.")
								
					if (game_states["southaccesspanel"] == 0):
						print("It's securely locked.")
					
				if (game_states["roomid"] == 5):

					if (game_states["northaccesspanel"] != 0):
						print("It's already open.")
								
					if (game_states["northaccesspanel"] == 0):
						game_states["northaccesspanel"] = 1
						game_states["northdoor"] = 0
						print("Opening the metal access panel reveals two switches.")
						print("You can see a black switch here.")
						print("You can see a white switch here.")	
						print("The light above the door in the south is now red.")
								
				return()
			
		# CLOSE METAL ACCESS PANEL
		if (player_input == 'close access panel' or 
			player_input == 'close panel' or 	
			player_input == 'close access' or 	
			player_input == 'close metal access' or 
			player_input == 'close metal panel' or 													
			player_input == 'close metal access panel'):

				if (game_states["roomid"] == 1 or game_states["roomid"] == 2 or game_states["roomid"] == 3):

					if (player_input == 'close access panel'):
						print("There isn't any access panel here.")
					
					if (player_input == 'close panel'):
						print("There isn't any panel here.")
						
					if (player_input == 'close access'):
						print("What access?")
					 			
					if (player_input == 'close metal access'):
						print("What metal access?")
					 						
					if (player_input == 'close metal access panel'):
						print("There isn't any metal access panel here.")
					
					if (player_input == 'close metal panel'):
						print("There isn't any metal panel here.")
										
				if (game_states["roomid"] == 4):

					if (game_states["southaccesspanel"] == 0 or 
						game_states["southaccesspanel"] == 1):
						print("It's already closed.")
								
					if (game_states["southaccesspanel"] == 2):
						game_states["southaccesspanel"] = 1
						game_states["southdoor"] = 1
						print("You close the metal access panel.")
						print("The light above the door in the north is now green.")

				if (game_states["roomid"] == 5):

					if (game_states["northaccesspanel"] == 0):
						print("It's already closed.")
								
					if (game_states["northaccesspanel"] != 0):
						game_states["northaccesspanel"] = 0
						game_states["northdoor"] = 1
						print("You close the metal access panel.")
						print("The light above the door in the south is now green.")
								
				return()
				
		# TAKE METAL ACCESS PANEL
		if (player_input == 'take access panel' or 
			player_input == 'take panel' or 	
			player_input == 'take access' or 	
			player_input == 'take metal access' or 
			player_input == 'take metal panel' or 													
			player_input == 'take metal access panel'):

			if (game_states["roomid"] == 1 or game_states["roomid"] == 2 or game_states["roomid"] == 3):

				if (player_input == 'take access panel'):
					print("There isn't any access panel here.")
				
				if (player_input == 'take panel'):
					print("There isn't any panel here.")
					
				if (player_input == 'take access'):
					print("What access?")
				 			
				if (player_input == 'take metal access'):
					print("What metal access?")
				 					
				if (player_input == 'take metal access panel'):
					print("There isn't any metal access panel here.")
				
				if (player_input == 'take metal panel'):
					print("There isn't any metal panel here.")
									
			if (game_states["roomid"] == 4 or 
				game_states["roomid"] == 5):
				print("You try to tear the metal access panel out of the wall but it's proving to be impossible.")
			
			return()		
							
		# LOOK SENSOR
		if (player_input == 'look sensor' or 
			player_input == 'look light sensor'):

			if (game_states["roomid"] == 3):
				print("It's a light sensor embedded in the ceiling.")
			
			if (game_states["roomid"] != 3):
				print("What sensor?")
			
			return()
				
		# TAKE SENSOR
		if (player_input == 'take sensor' or 
			player_input == 'take light sensor'):

			if (game_states["roomid"] == 3):
				print("The sensor is firmly embedded in the ceiling, you can't dislodge it.")
			
			if (game_states["roomid"] != 3):
				print("What sensor?")
			
			return()
				
		# LOOK PILE OF RUBBISH
		if (player_input == 'look rubbish' or 
			player_input == 'look pile of rubbish' or 
			player_input == 'look rubbish pile' or 
			player_input == 'look pile rubbish'):

			if (game_states["roomid"] == 4):
				print("It's a pile of rubbish.")
							
			if (game_states["roomid"] != 4):
				print("What rubbish?")
			
			return()
			
		# TAKE PILE OF RUBBISH / SEARCH PILE OF RUBBISH
		if (player_input == 'take rubbish' or 
			player_input == 'take pile of rubbish' or
			player_input == 'take pile rubbish' or 
			player_input == 'take rubbish pile' or			
			player_input == 'move rubbish' or
			player_input == 'move pile of rubbish' or
			player_input == 'move pile rubbish' or	
			player_input == 'move rubbish pile' or					
			player_input == 'search rubbish' or 		
			player_input == 'search pile rubbish' or 		
			player_input == 'search pile of rubbish' or 
			player_input == 'search rubbish pile'):	

			if (game_states["roomid"] == 4):
				print("You decide to search the pile of rubbish.")

				if ("flashlight" in inventory):
					print("After a few minutes of searching, you haven't found anything useful.")
									
				if ("flashlight" not in inventory):
					print("After a few minutes of searching, you find a flashlight.")
					print("You take the flashlight.")
					inventory.append("flashlight")

			if (game_states["roomid"] != 4):
				print("What rubbish?")

			return()
			
		# LOOK PLANTER
		if (player_input == 'look planter' or 
			player_input == 'look large planter'):

			if (game_states["roomid"] == 4):

				if (game_states["planter"] == 0):
					print("It's a large planter. It's broken and beginning to crumble.")
				
				if (game_states["planter"] != 0):
					print("The planter had crumbled into a pile of dirt.")
								
			if (game_states["roomid"] != 4):
				print("What planter?")
			
			return()
			
		# TAKE PLANTER
		if (player_input == 'take planter' or 
			player_input == 'take large planter'):	

			if (game_states["roomid"] == 4):

				if (game_states["planter"] != 0):
					print("The planter is just a pile of dirt now.  You can't take it.")
									
				if (game_states["planter"] == 0):
					print("You try to move the planter.")
					print("Since it is already crumbling, it readily collapses and crumbles into a pile of dirt.")
					print("There is a brass key partially buried in the pile of dirt.")
					game_states["deadplant"] = 1
					game_states["planter"] = 1
							
			if (game_states["roomid"] != 4):
				print("What planter?")
			
			return()
					
		# LOOK PILE OF DIRT / LOOK DIRT
		if (player_input == 'look dirt' or 
			player_input == 'look pile of dirt' or
			player_input == 'look dirt pile' or 
			player_input == 'look pile dirt'):

			if (game_states["roomid"] == 4 and 
				game_states["planter"] != 0):			
				print("It's a pile of dried soil.")				
							
			else:
				print("What dirt?")
			
			return()
				
		# TAKE PILE OF DIRT / TAKE DIRT
		if (player_input == 'take dirt' or 
			player_input == 'take pile of dirt' or
			player_input == 'take dirt pile' or 
			player_input == 'take pile dirt'):

			if (game_states["roomid"] == 4 and 
				game_states["planter"] != 0):
				print("You can't take it, you don't have anything to carry the pile of dirt in.")

			else:
				print("What dirt?")
			
			return()
					
		# LOOK DEAD PLANT / LOOK PLANT
		if (player_input == 'look dead plant' or 
			player_input == 'look plant'):

			if (game_states["roomid"] == 4):

				if (game_states["deadplant"] == 0):
					print("It's a long-dead plant.")
				
				if (game_states["deadplant"] != 0):
					print("The dead plant is just a pile of dust now.")

			if (game_states["roomid"] != 4):
				print("What plant?")
			
			return()
								
		# TAKE DEAD PLANT / TAKE PLANT
		if (player_input == 'take dead plant' or 
			player_input == 'take plant'):	

			if (game_states["roomid"] == 4):

				if (game_states["deadplant"] != 0):
					print("The dead plant is just a pile of dust now.  You can't take it.")
							
				if (game_states["deadplant"] == 0):
					print("As soon as you touch it, the plant crumbles into a pile of dust.")
					game_states["deadplant"] = 1
							
			if (game_states["roomid"] != 4):
				print("What plant?")
			
			return()
								
		# LOOK PILE OF DUST / LOOK DUST
		if (player_input == 'look dust' or 
			player_input == 'look pile of dust' or
			player_input == 'look dust pile' or 
			player_input == 'look pile dust'):

			if (game_states["roomid"] == 4 and 
				game_states["deadplant"] != 0):
				print("It's a dead plant that had crumbled into a pile of dust.")
			
			else:
				print("What dust?")
							
			return()
				
		# TAKE PILE OF DUST / TAKE DUST
		if (player_input == 'take dust' or 
			player_input == 'take pile of dust' or
			player_input == 'take dust pile' or 
			player_input == 'take pile dust'):

			if (game_states["roomid"] == 4 and 
				game_states["deadplant"] != 0):
				print("You can't take the pile of dust.  They're too fine to take ahold of.")

			else:
				print("What dust?")
			
			return()
					
		# LOOK GEARS
		if (player_input == 'look gears' or 
			player_input == 'look gear' or 
			player_input == 'look large gear' or 						
			player_input == 'look large gears'):

			if (game_states["roomid"] == 4):
				print("Large and heavy-looking rusting gears are stacked up in a corner.")
				print("You're not sure if you'll be able to lift a gear.")
							
			if (game_states["roomid"] != 4):
				if (player_input == 'look gears' or 
					player_input == 'look large gears'):
					print("What gears?")
				
				if (player_input == 'look gear' or 
					player_input == 'look large gear'):
					print("What gear?")
					
			return()
				
		# TAKE GEARS
		if (player_input == 'take gears' or 
			player_input == 'take gear' or 
			player_input == 'take large gear' or 						
			player_input == 'take large gears'):

			if (game_states["roomid"] == 4):
				print("You try to lift one of gears, but they're too heavy. You can't take them.")
			
			if (game_states["roomid"] != 4):
				if (player_input == 'take gears' or 
					player_input == 'take large gears'):
					print("What gears?")
				
				if (player_input == 'take gear' or 
					player_input == 'take large gear'):
					print("What gear?")
					
			return()
					
		# LOOK SPRINGS
		if (player_input == 'look springs' or 
			player_input == 'look spring'):

			if (game_states["roomid"] == 4):
				print("Springs of varying sizes are scattered all over the room.")
				print("They're severely rusted.")
							
			if (game_states["roomid"] != 4):
				if (player_input == 'look springs'):
					print("What springs?")
				
				if (player_input == 'look spring'):
					print("What spring?")
							
			return()
					
		# TAKE SPRINGS
		if (player_input == 'take springs' or 
			player_input == 'take spring'):

			if (game_states["roomid"] == 4):
				print("You try to take some, but they're heavily rusted and crumbled in your hand.")
				print("You can't take them.")
			
			if (game_states["roomid"] != 4):

				if (player_input == 'take springs'):
					print("What springs?")
				
				if (player_input == 'take spring'):
					print("What spring?")
											
			return()
							

		# LOOK PRESSURE PLATE
		if (player_input == 'look pressure plate' or 
			player_input == 'look pressure' or
			player_input == 'look plate'):

			if (game_states["roomid"] == 5):
				print("The pressure plate is almost invisible on the floor.")
				print("The only reason you know it is there is because you felt it "
					   "as you entered the room.")
			
			if (game_states["roomid"] != 5):

				if (player_input == 'look pressure plate'):
					print("There isn't any pressure plate here.")
				
				if (player_input == 'look pressure'):
					print("What pressure?")
					
				if (player_input == 'look plate'):
					print("There isn't any plate here.")
										
			return()
					
		# TAKE PRESSURE PLATE
		if (player_input == 'take pressure plate' or 
			player_input == 'take pressure' or
			player_input == 'take plate'):

			if (game_states["roomid"] == 5):
				print("The pressure plate seems to be an integral part of the floor.")
				print("As much as you try to, you can't take it.")

			if (game_states["roomid"] != 5):

				if (player_input == 'take pressure plate'):
					print("There isn't any pressure plate here.")
				
				if (player_input == 'take pressure'):
					print("What pressure?")
					
				if (player_input == 'take plate'):
					print("There isn't any plate here.")

			return()
			
		# QUITTING THE GAME                        
		if player_input == 'q' or player_input == 'quit':
			end()		

		# CATCH-ALL FOR EVERY OTHER INPUTS 
		else:
			print("I don't understand \""+player_input+".\"")
			return()			

#######################################################################
#                              END GAME                               #
#######################################################################
def end():
	if game_states["escaped"] == 0:
		while True:
			clear()
			print("\t\t-----------------------------------------------")
			print("\t\t\t\t   ESCAPE")
			print("\t\t-----------------------------------------------")
			print("\nThanks for playing.")
			player_input = input("")
			clear()
			exit()

	if game_states["escaped"] != 0:
		while True:
			clear()
			print("\t\t-----------------------------------------------")
			print("\t\t\t\t   THE ESCAPE")
			print("\t\t-----------------------------------------------")
			print("\nAfter pushing the iron gate open, you run down the "
				  "passage...")
			print("and you step out of the passage into an open grassy "
				  "meadow!")
			print("\n")
			print("You have escaped!  Congratulations!")			
			player_input = input("")
			clear()
			exit()		


#######################################################################
#                            INVENTORY                                #
#######################################################################
def playerinventory():
	if len(inventory) != 0:
		print("\n-----------------------------")
		print("\t  INVENTORY")
		print("-----------------------------")
		print("You're carrying: ")
		for item in inventory:
			print(item)

	if len(inventory) == 0:
		print("\n-----------------------------")
		print("\t  INVENTORY")
		print("-----------------------------")
		print("You're not carrying anything.\n")


#######################################################################
#                              DEBUG                                  #
#######################################################################
def debug():

		while True:

			clear()

			print("\t\t-----------------------------------------------")
			print("\t\t\t\t   DEBUG")
			print("\t\t-----------------------------------------------\n\n")

			print("Which action do you want to take?")
			print("1: Add items to inventory")
			print("2: Remove items from inventory")			
			print("3: Change game states")
			print("4: Change room")
			print("5: Exit to the game")
			print("6: Quit the game")

			debug_input = input("\n> ")
			debug_input = debug_input.strip()
			debug_input = debug_input.lower()
				
			if debug_input == "1":

				while True:

					clear()

					print("\t\t-----------------------------------------------")
					print("\t\t\t\tDEBUG - ADD ITEM")
					print("\t\t-----------------------------------------------")				
					print("\n\nEnter the item to add to inventory.")
					print("List of items in the game:")
					print('"paper", "flashlight", "aluminum key", "brass key", '
						'"iron key", "batteries"')
					print('Enter "all" to add everything to inventory.')
					print('Type "exit" when you are done.')	

					debug_input = input("\n> ")

					debug_input = debug_input.strip()
					debug_input = debug_input.lower()

					if debug_input == "paper":
						inventory.append("paper")
						print("\nPaper added to inventory.")
						print("Press enter to continue.")
						input("\n")						
						continue

					if debug_input == "flashlight":
						inventory.append("flashlight")
						print("\nFlashlight added to inventory.")
						print("Press enter to continue.")
						input("\n")							
						continue				

					if debug_input == "aluminum key":
						inventory.append("aluminum key")
						print("\nSilver key added to inventory.")
						print("Press enter to continue.")
						input("\n")							
						continue

					if debug_input == "brass key":
						inventory.append("brass key")
						print("\nGold key added to inventory.")
						print("Press enter to continue.")
						input("\n")							
						continue		

					if debug_input == "iron key":
						inventory.append("iron key")
						print("\nIron key added to inventory.")
						print("Press enter to continue.")
						input("\n")							
						continue

					if debug_input == "batteries":
						inventory.append("batteries")
						print("\nBatteries added to inventory.")
						print("Press enter to continue.")
						input("\n")							
						continue

					if debug_input == "all":
						inventory.append("paper")
						inventory.append("flashlight")
						inventory.append("aluminum key")
						inventory.append("brass key")
						inventory.append("iron key")
						inventory.append("batteries")	
						print("\nAll items added to inventory.")
						print("Press enter to continue.")
						input("\n")													
						continue		

					if debug_input == "exit":
						debug()

					else:
						print("\nNot a valid item or input.")
						print("Press enter to continue.")
						input("\n")						
						continue

			if debug_input == "2":

				while True:

					clear()

					print("\t\t-----------------------------------------------")
					print("\t\t\t\tDEBUG - REMOVE ITEM")
					print("\t\t-----------------------------------------------")				
					print("\n\nEnter the item to remove from inventory.")
					print("List of items in the game:")
					print('"paper", "flashlight", "aluminum key", "brass key", '
						'"iron key", "batteries"')
					print('Enter "all" to remove everything from inventory.')
					print('Type "exit" when you are done.')	

					debug_input = input("\n> ")

					debug_input = debug_input.strip()
					debug_input = debug_input.lower()

					if debug_input == "paper":
						if "paper" in inventory:
							inventory.remove("paper")
							print("\nPaper removed from inventory.")
							print("Press enter to continue.")
							input("\n")
							continue
						else:
							print("\nPaper wasn't in the inventory.")
							print("Press enter to continue.")
							input("\n")							
							continue

					if debug_input == "flashlight":
						if "flashlight" in inventory:
							inventory.remove("flashlight")
							print("\nFlashlight removed from inventory.")
							print("Press enter to continue.")
							input("\n")							
							continue
						else:
							print("\nFlashlight wasn't in the inventory.")
							print("Press enter to continue.")
							input("\n")
							continue				

					if debug_input == "aluminum key":
						if "aluminum key" in inventory:
							inventory.remove("aluminum key")
							print("\nSilver key removed from inventory.")
							print("Press enter to continue.")
							input("\n")
							continue
						else:
							print("\nSilver key wasn't in the inventory.")
							print("Press enter to continue.")
							input("\n")
							continue	

					if debug_input == "brass key":
						if "brass key" in inventory:
							inventory.remove("brass key")
							print("\nGold key removed from inventory.")
							print("Press enter to continue.")
							input("\n")
							continue
						else:
							print("\nGold key wasn't in the inventory.")
							print("Press enter to continue.")
							input("\n")
							continue		

					if debug_input == "iron key":
						if "iron key" in inventory:
							inventory.remove("iron key")
							print("\nIron key removed from inventory.")
							print("Press enter to continue.")
							input("\n")
							continue
						else:
							print("\nIron key wasn't in the inventory.")
							print("Press enter to continue.")
							input("\n")
							continue

					if debug_input == "batteries":
						if "batteries" in inventory:
							inventory.remove("batteries")
							print("\nBatteries removed from inventory.")
							print("Press enter to continue.")
							input("\n")							
							continue
						else:
							print("\nBatteries wasn't in the inventory.")
							print("Press enter to continue.")
							input("\n")							
							continue

					if debug_input == "all":
						inventory.clear()	
						print("\nAll items removed from inventory.")						
						print("Press enter to continue.")
						input("\n")						
						continue	

					if debug_input == "exit":
						debug()

					else:
						print("\nNot a valid item or input.")
						print("Press enter to continue.")
						input("\n")						
						continue

			if debug_input == "3":

				while True:

					clear()

					print("\t\t-----------------------------------------------")
					print("\t\t\t     DEBUG - MODIFY STATES")
					print("\t\t-----------------------------------------------")
					print("\n\nEnter the state to modify.")
					print("List of states in the game:")
					print('"roomid", "northdoor", "southdoor", "eastdoor", '
						'"westdoor", \n"bronzebox", "northaccesspanel", '
						'"steelbox", "southaccesspanel", \n"deadplant", ' 
						'"planter", "flashlight", "flashlightbatteries", ' 
						'\n"titaniumbox", "tungstengate", "escaped"')
					print('Type "exit" when you are done.')		

					debug_input = input("\n> ")

					debug_input = debug_input.strip()
					debug_input = debug_input.lower()

					if debug_input == "roomid":
						print("Current state is",game_states['roomid'])
						print("Enter the desired state.")
						print("1 - Center, 2 - East, 3 - West, 4 - South,"
							" 5 - North.  0 - Opening, 6 - Ending.")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['roomid'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue				

					if debug_input == "northdoor":
						print("Current state is",game_states['northdoor'])
						print("Enter the desired state (0 (locked) "
							"or 1 (open))")
						debug_input = input("\n> ")						
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['northdoor'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue

					if debug_input == "southdoor":
						print("Current state is",game_states['southdoor'])
						print("Enter the desired state (0 (locked) "
							"or 1 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['southdoor'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue

					if debug_input == "eastdoor":
						print("Current state is",game_states['eastdoor'])
						print("Enter the desired state (0 (locked) "
							"or 1 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['eastdoor'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue

					if debug_input == "westdoor":
						print("Current state is",game_states['westdoor'])
						print("Enter the desired state (0 (locked) "
							"or 1 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['westdoor'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue

					if debug_input == "bronzebox":
						print(f"Current state is",game_states['bronzebox'])
						print("Enter the desired state (0 (locked) "
							"or 1 (unlocked) or 2 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['bronzebox'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue

					if debug_input == "northaccesspanel":
						print("Current state is", game_states['northaccesspanel'])
						print("Enter the desired state (0 (locked) or "
								"1 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['northaccesspanel'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")	
							continue						
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue		

					if debug_input == "southaccesspanel":
						print("Current state is", game_states['southaccesspanel'])
						print("Enter the desired state (0 (locked) "
								"or 1 (unlocked) or 2 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['southaccesspanel'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")						
							continue	

					if debug_input == "steelbox":
						print("Current state is",game_states['steelbox'])
						print("Enter the desired state (0 (locked) "
								"or 1 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['steelbox'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue		

					if debug_input == "titaniumbox":
						print("Current state is",game_states['titaniumbox'])
						print("Enter the desired state (0 (locked) or "
								"1 (open))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['titaniumbox'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue		

					if debug_input == "deadplant":
						print("Current state is", game_states['deadplant'])
						print("Enter the desired state (0 (not crumbled) "
								"or 1 (crumbled))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['deadplant'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue	

					if debug_input == "planter":
						print(f"Current state is", game_states['planter'])
						print("Enter the desired state (0 (not crumbled) "
								"or 1 (crumbled))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['planter'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue		

					if debug_input == "flashlight":
						print("Current state is", game_states['flashlight'])
						print("Enter the desired state (1 (not on) or "
								"1 (on))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['flashlight'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue	

					if debug_input == "flashlightbatteries":
						print("Current state is", game_states['flashlightbatteries'])
						print("Enter the desired state (0 (not in "
								"flashlight) or 1 (in flashlight))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['flashlightbatteries'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue	

					if debug_input == "tungstengate":
						print("Current state is", game_states['tungstengate'])
						print("Enter the desired state (0 (locked) "
								"or 1 (unlocked))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['tungstengate'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")							
							continue	

					if debug_input == "escaped":
						print("Current state is", game_states['escaped'])
						print("Enter the desired state (0 (not escaped) "
								"or 1 (escaped))")
						debug_input = input("\n> ")
						try:
							debug_input = debug_input.strip()
							debug_input = int(debug_input)
							game_states['escaped'] = debug_input
							print("\nState modified.")
							print("Press enter to continue.")
							input("\n")							
							continue
						except:
							print("\nInvalid input.  Returning to modify state menu.")
							print("Press enter to continue.")
							input("\n")						
							continue	

					if debug_input == "exit":
						debug()
					else:
						print("\nNot a valid input.")
						print("Press enter to continue.")
						input("\n")						
						continue		

			if debug_input == "4":

				while True:

					clear()

					print("\t\t-----------------------------------------------")
					print("\t\t\t      DEBUG - CHANGE ROOM")
					print("\t\t-----------------------------------------------")
					print("\n\nEnter the name of the area you want to go to: ")
					print('\nList of rooms: Opening, Center, North, East, South, West, Ending')	
					print('\nType "exit" to go back to debug main menu.')

					debug_input = input("\n> ")

					debug_input = debug_input.strip()
					debug_input = debug_input.lower()

					if debug_input == 'opening':
						opening()
					if debug_input == 'center':
						centerroom()
					if debug_input == 'north':
						northroom()
					if debug_input == 'south':
						southroom()
					if debug_input == 'east':
						eastroom()
					if debug_input == 'west':
						westroom()
					if debug_input == 'ending':
						end()						
					if debug_input == 'exit':
						debug()
					else:
						print("\nNot a valid input.")
						print("Press enter to continue.")
						input("\n")						
						continue

			if debug_input == '5':
				if game_states["roomid"] == 0:
					opening()				
				if game_states["roomid"] == 1:
					centerroom()
				if game_states["roomid"] == 2:
					eastroom()	
				if game_states["roomid"] == 3:
					westroom()	
				if game_states["roomid"] == 4:
					southroom()	
				if game_states["roomid"] == 5:
					northroom()	
				if game_states["roomid"] == 6:
					end()						
				else:
					print("\t\t-----------------------------------------------")
					print("\t\t\t\t   DEBUG")
					print("\t\t-----------------------------------------------\n\n")
					print("\nInvalid room id.")
					print("Press enter to continue.")
					input("\n")					
					continue
					
			if debug_input == '6':
				end()

			else:
				print("\nNot a valid input.")
				print("Press enter to continue.")
				input("\n")				
				continue

#######################################################################
#                       SAVING THE GAME TO FILE                       #
#######################################################################
# PYTHON3 VERSION OF ESCAPE ALSO ACCEPT SAVE FILES FROM C VERSION OF 
# ESCAPE, AND VICE VERSA.
def saveGame():

	while True:

		s_roomid = game_states["roomid"]
		s_northdoor = game_states["northdoor"]
		s_southdoor = game_states["southdoor"]
		s_eastdoor = game_states["eastdoor"]
		s_westdoor = game_states["westdoor"]
		s_bronzebox = game_states["bronzebox"]
		s_northaccesspanel = game_states["northaccesspanel"]
		s_steelbox = game_states["steelbox"]
		s_southaccesspanel = game_states["southaccesspanel"]
		s_deadplant = game_states["deadplant"]
		s_planter = game_states["planter"]
		s_flashlight = game_states["flashlight"]
		s_flashlightbatteries = game_states["flashlightbatteries"]
		s_titaniumbox = game_states["titaniumbox"]
		s_tungstengate = game_states["tungstengate"]
		s_escaped = game_states["escaped"]
		if "paper" in inventory:
			s_paper = 1
		if "paper" not in inventory:
			s_paper = 0
		if "brass key" in inventory:
			s_brasskey = 1
		if "brass key" not in inventory:
			s_brasskey = 0			
		if "aluminum key" in inventory:
			s_aluminumkey = 1
		if "aluminum key" not in inventory:
			s_aluminumkey = 0
		if "iron key" in inventory:
			s_ironkey = 1
		if "iron key" not in inventory:
			s_ironkey = 0	
		if "flashlight" in inventory:
			s_flashlightinventory = 1
		if "flashlight" not in inventory:
			s_flashlightinventory = 0	
		if "batteries" in inventory:
			s_batteries = 1
		if "batteries" not in inventory:
			s_batteries = 0	

		savefiledata = (str(s_roomid) + str(s_northdoor) + str(s_southdoor) + str(s_eastdoor) + str(s_westdoor) + str(s_bronzebox) + 
		str(s_northaccesspanel) + str(s_steelbox) + str(s_southaccesspanel) + str(s_deadplant) + str(s_planter) + str(s_flashlight) + 
		str(s_flashlightbatteries) + str(s_titaniumbox) + str(s_tungstengate) + str(s_escaped) + str(s_paper) + str(s_brasskey) +
		str(s_aluminumkey) + str(s_ironkey) + str(s_flashlightinventory) + str(s_batteries))

		clear()

		print("\t\t-----------------------------------------------")
		print("\t\t\t\t   SAVE")
		print("\t\t-----------------------------------------------\n")

		print("Please enter the name of the save file.")

		save_input = input("\n> ")
		save_input = save_input.strip()		
		save_input = save_input.lower()

		savefilename = save_input + ".escape"

		savefile = open(savefilename, "w")

		savefile.write(savefiledata)

		savefile.close()

		print("\nGame saved.  Press enter to return to the game.")
		input("\n")

		if game_states["roomid"] == 0:
			opening()
		if game_states["roomid"] == 1:
			centerroom()
		if game_states["roomid"] == 2:
			eastroom()
		if game_states["roomid"] == 3:
			westroom()
		if game_states["roomid"] == 4:
			southroom()
		if game_states["roomid"] == 5:
			northroom()
		if game_states["roomid"] == 6:
			end()	
		else:
			print("NOT A VALID ROOM ID!")
			input("")			

#######################################################################
#                    LOADING THE GAME FROM FILE                       #
#######################################################################
def loadGame():

	while True:

		clear()

		print("\t\t-----------------------------------------------")
		print("\t\t\t\t   LOAD")
		print("\t\t-----------------------------------------------\n")

		print("Please enter the name of the save file.")

		load_input = input("\n> ")
		load_input = load_input.strip()		
		load_input = load_input.lower()

		savefilename = load_input + ".escape"

		try: 
			savefile = open(savefilename, "r")

			savefiledata = savefile.read()

			game_states["roomid"] = int(savefiledata[0])
			game_states["northdoor"] = int(savefiledata[1])
			game_states["southdoor"] = int(savefiledata[2])
			game_states["eastdoor"] = int(savefiledata[3])
			game_states["westdoor"] = int(savefiledata[4])
			game_states["bronzebox"] = int(savefiledata[5])
			game_states["northaccesspanel"] = int(savefiledata[6])
			game_states["steelbox"] = int(savefiledata[7])
			game_states["southaccesspanel"] = int(savefiledata[8])
			game_states["deadplant"] = int(savefiledata[9])
			game_states["planter"] = int(savefiledata[10])
			game_states["flashlight"] = int(savefiledata[11])
			game_states["flashlightbatteries"] = int(savefiledata[12])
			game_states["titaniumbox"] = int(savefiledata[13])
			game_states["tungstengate"] = int(savefiledata[14])
			game_states["escaped"] = int(savefiledata[15])
			s_paper = int(savefiledata[16])
			s_brasskey = int(savefiledata[17])
			s_aluminumkey = int(savefiledata[18])
			s_ironkey = int(savefiledata[19])
			s_flashlightinventory = int(savefiledata[20])
			s_batteries = int(savefiledata[21])

			if s_paper == 1:
				inventory.append("paper")
			if s_brasskey == 1:
				inventory.append("brass key")
			if s_aluminumkey == 1:
				inventory.append("aluminum key")
			if s_ironkey == 1:
				inventory.append("iron key")
			if s_flashlightinventory == 1:
				inventory.append("flashlight")
			if s_batteries == 1:
				inventory.append("batteries")

			savefile.close()

			print("\nGame loaded.  Press enter to return to the game.")

		except:
			print("\nError opening the file.  Press enter to return to the game.")


		input("\n")

		if game_states["roomid"] == 0:
			opening()
		if game_states["roomid"] == 1:
			centerroom()
		if game_states["roomid"] == 2:
			eastroom()
		if game_states["roomid"] == 3:
			westroom()
		if game_states["roomid"] == 4:
			southroom()
		if game_states["roomid"] == 5:
			northroom()
		if game_states["roomid"] == 6:
			end()
		else:
			print("NOT A VALID ROOM ID!")
			input("")

#######################################################################
#                               MAIN                                  #
#######################################################################
def main():
	opening()

# GAME BEGINS HERE
main()	
