# playing controls whether the adventure continues
playing = True

def great_hall():
    print("You stand in the Great Hall. Candles float overhead.")
    choice = input("Go to (c)ourtyard or (l)ibrary? ")
    if choice == "c":
        courtyard()
    elif choice == "l":
        library()
    else:
        print("You hesitate and stay put.")

def courtyard():
    print("Cold air. The fountain is frozen.")
    if input("Return to hall? (y/n) ") == "y":
        great_hall()
    else:
        print("You explore the grounds...")

def library():
    print("Thousands of books whisper on the shelves.")
    playing = False   # local variable — see Module 9 for global
    print("You found a secret passage. Game over!")

while playing:
    great_hall()
    # In a full game, set playing = False when the player wins or quits
