[go: up one dir, main page]

0% found this document useful (0 votes)
13 views1 page

adventure.py

The document outlines an interactive adventure game where the player must navigate through a dark cave. Players make choices that lead to different outcomes, such as finding treasure or falling into a pit. The game begins with an introduction and prompts the player to decide whether to enter the cave.

Uploaded by

umeebaktyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

adventure.py

The document outlines an interactive adventure game where the player must navigate through a dark cave. Players make choices that lead to different outcomes, such as finding treasure or falling into a pit. The game begins with an introduction and prompts the player to decide whether to enter the cave.

Uploaded by

umeebaktyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

def intro():

print("Welcome to the Adventure Game!")


print("Your goal is to make it through a dark cave.")
print("Choose wisely, as your choices will lead to different outcomes.")
print("You are standing at the entrance of a dark cave. Do you want to enter?")

def choice_1():
choice = input("Type 'yes' to enter the cave or 'no' to stay outside:
").lower()
if choice == "yes":
print("You step inside, the darkness envelops you. What do you do next?")
choice_2()
else:
print("You decide not to enter the cave. Game over.")

def choice_2():
print("Inside the cave, you see two paths: one to the left and one to the
right.")
choice = input("Type 'left' to go left or 'right' to go right: ").lower()
if choice == "left":
print("You walk down the left path and discover a hidden treasure chest!")
print("Congratulations, you win!")
elif choice == "right":
print("You walk down the right path and fall into a pit. You have died.")
else:
print("Invalid choice. Please type 'left' or 'right'.")
choice_2()

# Start the game


intro()
choice_1()

You might also like