import sys
def start_game():
print(“Welcome to the adventure game!”)
print(“You find yourself in a mysterious cave. The cave is dark and damp, but you can make out a faint light in the distance.”)
print(“Do you want to move towards the light or stay where you are? (move/stay)”)
choice = input().strip() if choice == "move": move_towards_light() elif choice == "stay": stay() else: print("Invalid choice. Please enter 'move' or 'stay'.") start_game()
def move_towards_light():
print(“As you move towards the light, you hear a deep rumbling noise.”)
print(“Do you want to investigate the noise or turn back? (investigate/turn back)”)
choice = input().strip() if choice == "investigate": investigate() elif choice == "turn back": turn_back() else: print("Invalid choice. Please enter 'investigate' or 'turn back'.") move_towards_light()
def investigate():
print(“As you get closer to the noise, you see a giant dragon in front of you.”)
print(“Do you want to fight the dragon or try to sneak past it? (fight/sneak)”)
choice = input().strip() if choice == "fight": fight() elif choice == "sneak": sneak() else: print("Invalid choice. Please enter 'fight' or 'sneak'.") investigate()
def fight():
print(“You bravely face the dragon and engage in a fierce battle.”)
print(“After a long and grueling fight, you emerge victorious!”)
print(“As you search the dragon’s lair, you find a mysterious message inscribed on the wall:”)
print(“‘all your base are belong to us'”)
print(“You realize that this is the ultimate answer to the mystery of the cave.”)
print(“Congratulations, you have completed the adventure!”)
sys.exit()
def sneak():
print(“You try to sneak past the dragon, but it notices you and chases after you.”)
print(“You run as fast as you can, but the dragon catches up to you.”)
print(“You are burned alive by the dragon’s fiery breath.”)
print(“You have failed the adventure.”)
sys.exit()
def stay():
print(“You decide to stay where you are.”)
print(“You spend the rest of your days in the dark and damp cave, never finding the ultimate answer.”)
print(“You have failed the adventure.”)
sys.exit()
def turn_back():
print(“You turn back and head back the way you came.”)
print(“You spend the rest of your days in the dark and damp cave, never finding the ultimate answer.”)
print(“You have failed the adventure.”)
sys.exit()
start_game()