Treasure Island (Python)
Posted by admin on Feb 04, 2023 in Interactive fiction, Programozás
Posted by admin on Feb 04, 2023 in Interactive fiction, Programozás
print("Welcome to the treasure Island.")
print("Your mission is to find the treasure.")
choice1 = input('You are at a crossroad, where do you want to go? Type "left" or "right".').lower()
if choice1 == "left":
choice2 = input('You\'ve come to a lake. There is an island in the middle of the lake.
Type "wait" to wait a boat. Type "swim" to swim accross.').lower()
if choice2 == "wait":
choice3 = input("You arrive at the island unharmed. There is a house of 3 doors.
On red, on yellow and one blue. Which color do you choose?").lower()
if choice3 == "red":
print("It's a room of full of fire. Game over.")
elif choice3 == "yellow":
print("You found the treasure! You win!")
elif choice3 == "blue":
print("You enter a room of beasts. Game over.")
else:
print("You chose a door that doesn't exist. Game Over.")
else:
print("You've attacked by an angry trout. Game over.")
else:
print("You fell into a hole. Game over.")