Repository navigation
Expand file tree
/
Copy pathTreasureIsland.py
More file actions
69 lines (66 loc) · 3.98 KB
/
Copy pathTreasureIsland.py
File metadata and controls
69 lines (66 loc) · 3.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
print('''
____________________________________________________________________
/ \----- --------- ----------- -------------- ------ ----\
\_/__________________________________________________________________/
|~ ~~ ~~~ ~ ~ ~~~ ~ _____.----------._ ~~~ ~~~~ ~~ ~~ ~~~~~ ~~~~|
| _ ~~ ~~ __,---'_ " `. ~~~ _,--. ~~~~ __,---. ~~|
| | \___ ~~ / ( ) " " `-.,' (') \~~ ~ ( / _\ \~~ |
| \ \__/_ __(( _)_ ( " " (_\_) \___~ `-.___,' ~|
|~~ \ ( )_(__)_|( )) " )) " | " \ ~~ ~~~ _ ~~|
| ~ \__ (( _( ( )) ) _) (( \\// " | " \_____,' | ~|
|~~ ~ \ ( ))(_)(_)_)| " )) //\\ " __,---._ " " " /~~~|
| ~~~ |(_ _)| | | | " ( " ,-'~~~ ~~~ `-. ___ /~ ~ |
| ~~ | | | | _,--- ,--. _ " (~~ ~~~~ ~~~ ) /___\ \~~ ~|
| ~ ~~ / | _,----._,'`--'\.`-._ `._~~_~__~_,-' |H__| \ ~~|
|~~ / " _,-' / `\ ,' / _' \`.---.._ __ " \~ |
| ~~~ / / .-' , / ' _,'_ - _ '- _`._ `.`-._ _/- `--. " " \~|
| ~ / / _-- `---,~.-' __ -- _,---. `-._ _,-'- / ` \ \_ " |~|
| ~ | | -- _ /~/ `-_- _ _,' ' \ \_`-._,-' / -- \ - \_ / |
|~~ | \ - /~~| " ,-'_ /- `_ ._`._`-...._____...._,--' /~~|
| ~~\ \_ / /~~/ ___ `--- --- - - ' ,--. ___ |~ ~|
|~ \ ,'~~| " (o o) " " " |~~~ \_,-' ~ `. ,'~~ |
| ~~ ~|__,-'~~~~~\ \"/ " " " /~ ~~ O ~ ~~`-.__/~ ~~~|
|~~~ ~~~ ~~~~~~~~`.______________________/ ~~~ | ~~~ ~~ ~ ~~~~|
|____~jrei~__~_______~~_~____~~_____~~___~_~~___~\_|_/ ~_____~___~__|
/ \----- ----- ------------ ------- ----- ------- -------- -------\
\_/__________________________________________________________________/
''')
print("Welcome to Treasure Island!")
print("Your mission is to find the treasure.")
# \ is used to ignore some charachters
choice1 = input('You\'re at a crossroad, where do you want to go? Type "left" or "right".\n').lower()
# lower() is used to lower case
# tried code at my end which gives an error for wrong choices but works for right ones as it isn't looped into the conditions which was a mistake I made at my end
# if choice1 == "right":
# print("Fell into a hole! Game Over ;(")
# else:
# choice2 = input('You found a river after turning left what do you want to do "swim" across the river or "wait" for a boat.\n').lower()
# if choice2 == "swim":
# print("While swimming you got attacked by a trout! Game Over :(")
# else:
# choice3 = input('You have crossed the river and after crossing there are 3 doors you see\nWhich door do your want to choose "Red", "Blue", "Yellow".\n').lower()
# if choice3 == "red":
# print("After touching the Red door you got Burned by fire, Game Over :(")
# elif choice3 == "blue":
# print("After opening the Blue door you got Eaten by beasts, Game Over :(")
# elif choice3 == "yellow":
# print("After opening the Yellow Door you find the Lost Treasure of Black Beard:) You Won!")
# else:
# print("Game Over :(")
# correct code
if choice1 == "left":
choice2 = input('You found a river after turning left what do you want to do "swim" across the river or "wait" for a boat.\n').lower()
if choice2 == "wait":
choice3 = input('You have crossed the river and after crossing there are 3 doors you see\nWhich door do your want to choose "Red", "Blue", "Yellow".\n').lower()
if choice3 == "red":
print("After touching the Red door you got Burned by fire, Game Over :(")
elif choice3 == "yellow":
print("After opening the Yellow Door you find the Lost Treasure of Black Beard:) You Won!")
elif choice3 == "blue":
print("After opening the Blue door you got Eaten by beasts, Game Over :(")
else:
print("You choose a door that doesn't exist, Game Over :(")
else:
print("While swimming you got attacked by a trout! Game Over :(")
else:
print("Fell into a hole! Game Over ;(")