Code
Code
def get_input(prompt):
return input(prompt).lower()
return "forest"
return "start"
else:
return current_room
def examine_item(item):
"""Examines an item."""
if item == "tree":
else:
def play_game():
current_room = "start"
inventory = []
while True:
if current_room == "start":
if action == "north":
examine_item("tree")
break
else:
print("Invalid command.")
if action == "south":
break
else:
print("Invalid command.")
print("Game Over.")
play_game()
Output:
Game Over.