import random

print('''
*******************************************************************************
          |                   |                  |                     |
 _________|________________.=""_;=.______________|_____________________|_______
|                   |  ,-"_,=""     `"=.|                  |
|___________________|__"=._o`"-._        `"=.______________|___________________
          |                `"=._o`"=._      _`"=._                     |
 _________|_____________________:=._o "=._."_.-="'"=.__________________|_______
|                   |    __.--" , ; `"=._o." ,-"""-._ ".   |
|___________________|_._"  ,. .` ` `` ,  `"-._"-._   ". '__|___________________
          |           |o`"=._` , "` `; .". ,  "-._"-._; ;              |
 _________|___________| ;`-.o`"=._; ." ` '`."\` . "-._ /_______________|_______
|                   | |o;    `"-.o`"=._``  '` " ,__.--o;   |
|___________________|_| ;     (#) `-.o `"=.`_.--"_o.-; ;___|___________________
____/______/______/___|o;._    "      `".o|o_.--"    ;o;____/______/______/____
/______/______/______/_"=._o--._        ; | ;        ; ;/______/______/______/_
____/______/______/______/__"=._o--._   ;o|o;     _._;o;____/______/______/____
/______/______/______/______/____"=._o._; | ;_.--"o.--"_/______/______/______/_
____/______/______/______/______/_____"=.o|o_.--""___/______/______/______/____
/______/______/______/______/______/______/______/______/______/______/_____ /
*******************************************************************************
''')   


while True:
    print("Welcome to Treasure Island.")
    print("Your mission is to find the treasure.") 
    choice1 = input('You\'re 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 for a boat or type "swim" to swim across.').lower()
        if choice2 == "wait": 
            choice3 = input("You arrive at the island unharmed. There is a house with 3 doors, one red, one yellow and one blue. Which colour do you choose?").lower()
            if choice3 == "red":
                print("It's a room full of nesting magpies. You can't outrun them and you die. Game Over.")
            elif choice3 == "yellow":
                print("You've found the treasure! It is a chest full of one billion dollars and seat on the next ship to Mars! You Win!")
            elif choice3 == "blue":
                print("You enter a room full of accountants. You are bored to death. Game Over.")
            else:
                print("You chose a door that doesn't exist. Game Over")
        else:
            print("You can't swim you ning nong. You drown. Game Over.")
    else: 
        print("You fell into a blackhole and were never seen again. Game Over.")

    play_again = input('Do you want to play again? Type "yes" to play again or "no" to end the game.').lower()
    if play_again != "yes":
        break



