#gold = 0 def start(): #send the player the to correct area room = 0 global gold gold = 0 while True: if(room == 0): room = room0() elif room == 1: room = room1() elif room == 3: break # room = none print("You've found " + str(gold) + " gold so far.") print("you escaped") def room0(): print("This is a dark room.") choice = -1 choice = input("1) North \n2) West\n") print(choice) if choice == "1": return 1 if choice == "2": return 3 def room1(): print("This looks like a library.") global gold gold = gold + 5 print("You found 5 more gold.") choice = -1 while int(choice) < 1 or int(choice) > 2: choice = input("1) South \n2) Stay here\n") choice = int(choice) print(choice) if choice == 1: return 0 if int(choice) == 2: return 1