-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtreasure-island.py
250 lines (236 loc) · 15.4 KB
/
treasure-island.py
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
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_.--""___/______/______/______/____
/______/______/______/______/______/______/______/______/______/______/_____ /
*******************************************************************************
______ ____ ___ ____ _____ __ __ ____ ___
| || \ / _] / | / ___/| | || \ / _]
| || D ) / [_ | o |( \_ | | || D ) / [_
|_| |_|| / | _]| | \__ || | || / | _]
| | | \ | [_ | _ | / \ || : || \ | [_
| | | . \| || | | \ || || . \| |
|__| |__|\_||_____||__|__| \___| \__,_||__|\_||_____|
____ _____ _ ____ ____ ___
| |/ ___/| | / || \ | \
| |( \_ | | | o || _ || \
| | \__ || |___ | || | || D |
| | / \ || || _ || | || |
| | \ || || | || | || |
|____| \___||_____||__|__||__|__||_____|
*******************************************************************************
''')
boat_image = '''
┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┼█┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┌┌┼┼┼┼█┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┼┼┼┼┼┼█┌┌┌┌┌██┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌█┌┌┌┌▄█▄▄▄┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌█┌┌┌▀┌▐┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌█┌┌┌┌┌█▀█┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌████████████████████┌┌┌┌┌┌┌┌┌┌┌┌┌
─────────█┌┌┌┌┌┌┌┌┌┌┌┌┌┌█───────────────
┌┌┌┌┌┌┌┌┌███┌┌┌┌┌┌┌┌┌┌┌██┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌▐▄▄█▀▌┌┌┌▀█████████████┌┌┌┌┌┌█▀█▄▄▄█┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┌▀▀▀▀▀▀▀▀▀▀▀┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌┌┌██▄┌┌┌┌┌┌┌┌┌┌┌▄▄┌┌█┌┌┌┌┌┌┌┌┌┌┌
┌┌┌┌┌┌┌┌▄█┌┌┌█▄▄▄▄▄┌┌┌┌┌┌┌▀▀┌┌┌┌┌┌┌┌┌┌┌┌
█┌┌▄█▀▀▀┌┌┌┌┌┌┌┌▄┌┌██┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
███┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌█▀┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
▐┌┌┌┌┌┌┌┌┌┌┌┌┌▄▄▄▄█▀┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
█┌▄█▀▀▀▀▀▀▀▀▀▀┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
██┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
▀┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌┌
'''
map_paper = '''
▒▒▒▒▒▒▒▒┼▒▒▒▒▒▒▒▒┼▒▒▒▒▒▒▒▒▒▒▒▒▒▒┼▒▒┼▒▒▒▒▒▒▒┼▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒┼▒▒▒▒▒▒▒▒┼▒▒▒▒▒▒▒▒▒▒▒▒▒▒┼▒▒┼┼┼┼┼┼┼┼┼▒▒▒█████▒▒
▒▒▒▒▒▒▒▒┼┼┼┼┼┼▒┼┼┼▒▒▒┼┼┼┼┼┼┼┼┼┼┼┼▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▒▒▒█▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒┼▒┼▒▒▒▒▒┼▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█████▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒┼▒┼▒▒▒▒▒┼▒┼┼┼┼┼┼┼┼┼┼▒▒┼┼┼┼┼┼┼┼┼▒▒▒▒▒▒▒▒▒▒
┼┼┼┼┼┼┼┼┼┼┼┼┼┼▒┼┼┼┼┼▒┼▒┼▒▒▒▒▒▒▒▒┼▒▒┼▒▒▒▒▒▒▒┼┼┼┼┼┼┼┼┼┼┼
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒┼▒┼▒┼▒▒▒▒▒▒▒▒┼▒▒┼┼┼┼┼┼┼▒▒▒▒▒▒▒▒▒▒▒▒
┼┼┼▒▒┼┼┼┼┼┼┼┼┼▒┼┼┼▒┼▒┼▒┼▒▒▒▒▒▒▒▒┼▒▒▒▒▒▒▒▒┼▒▒▒▒▒┼┼┼┼┼┼▒
▒▒┼▒▒┼▒▒▒▒▒▒▒┼▒┼▒┼▒┼┼┼▒┼▒▒▒▒▒┼┼┼┼▒▒┼┼┼┼┼▒┼▒▒▒▒▒┼▒▒▒▒┼▒
▒▒┼▒▒┼▒▒▒▒▒▒▒┼▒┼▒┼▒▒▒▒▒┼▒▒▒▒▒┼▒▒▒▐█▒▒▒▒┼▒┼┼┼┼┼┼┼▒┼┼┼┼▒
▒▒┼▒▒┼▒▒▒▒▒▒▒┼▒┼▒┼┼┼┼┼┼┼┼┼┼┼┼┼▒▒█▒▄█▀▒▒▒▒▒▒▒▒▒▒▒▒┼▒▒▒▒
┼┼┼▒▒┼┼┼┼┼┼┼┼┼▒┼┼┼┼┼┼▒▒▒┼▒▒▒▒▒▒▒▒▀█▒▒▒▒┼┼┼┼┼┼┼┼┼▒┼▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▒▒▒▒▒┼▒▒▒┼▒┼┼┼┼▒▒▄█▀▄▒▒▒┼▒▒▒▒▒▒▒┼▒┼▒▒▒▒
┼┼┼┼┼┼┼▒┼┼┼┼┼┼▒┼┼┼┼▒┼▒▒▒┼▒┼▒▒┼▒▒▌▒▒▒▀▒▒┼▒▒▒▒▒▒▒┼▒┼▒▒▒▒
▒▒▒▒▒▒┼▒┼▒▒▒▒┼▒┼▒▒┼▒┼┼┼┼┼▒┼▒▒┼┼┼┼┼┼┼┼┼┼┼▒▒▒▒▒▒▒┼▒┼▒▒▒▒
▒▒▒▒▒▒┼▒┼▒▒▒▒┼▒┼▒▒┼▒▒▒▒▒▒▒┼▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒┼▒┼▒▒▒▒
▒▒▒▒▒┼┼▒┼┼▒▒▒┼▒┼▒▒┼┼┼┼┼┼┼┼┼▒▒▒▒╔═╦═╦══╦═╗▒▒▒▒▒▒┼┼┼▒▒▒▒
▒▒▒▒▒│┼█│┼▒▒▒┼┼┼▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║║║║║╔╗║╬║▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒║║║║║╠╣║╔╝▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╚╩═╩╩╝╚╩╝▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
'''
dead = '''
.... NO! ... ... MNO! ...
..... MNO!! ...................... MNNOO! ...
..... MMNO! ......................... MNNOO!! .
.... MNOONNOO! MMMMMMMMMMPPPOII! MNNO!!!! .
... !O! NNO! MMMMMMMMMMMMMPPPOOOII!! NO! ....
...... ! MMMMMMMMMMMMMPPPPOOOOIII! ! ...
........ MMMMMMMMMMMMPPPPPOOOOOOII!! .....
........ MMMMMOOOOOOPPPPPPPPOOOOMII! ...
....... MMMMM.. OPPMMP .,OMI! ....
...... MMMM:: o.,OPMP,.o ::I!! ...
.... NNM:::.,,OOPM!P,.::::!! ....
.. MMNNNNNOOOOPMO!!IIPPO!!O! .....
... MMMMMNNNNOO:!!:!!IPPPPOO! ....
.. MMMMMNNOOMMNNIIIPPPOO!! ......
...... MMMONNMMNNNIIIOO!..........
....... MN MOMMMNNNIIIIIO! OO ..........
......... MNO! IiiiiiiiiiiiI OOOO ...........
...... NNN.MNO! . O!!!!!!!!!O . OONO NO! ........
.... MNNNNNO! ...OOOOOOOOOOO . MMNNON!........
...... MNNNNO! .. PPPPPPPPP .. MMNON!........
...... OO! ................. ON! .......
................................
'''
win = '''
*******************************************************************************
| | | |
_________|________________.=""_;=.______________|_____________________|_______
| | ,-"_,="" `"=.| |
|___________________|__"=._o`"-._ `"=.______________|___________________
| `"=._o`"=._ _`"=._ |
_________|_____________________:=._o "=._."_.-="'"=.__________________|_______
| | __.--" , ; `"=._o." ,-"""-._ ". |
|___________________|_._" ,. .` ` `` , `"-._"-._ ". '__|___________________
| |o`"=._` , "` `; .". , "-._"-._; ; |
_________|___________| ;`-.o`"=._; ." ` '`."\` . "-._ /_______________|_______
| | |o; `"-.o`"=._`` '` " ,__.--o; |
|___________________|_| ; (#) `-.o `"=.`_.--"_o.-; ;___|___________________
____/______/______/___|o;._ " `".o|o_.--" ;o;____/______/______/____
/______/______/______/_"=._o--._ ; | ; ; ;/______/______/______/_
____/______/______/______/__"=._o--._ ;o|o; _._;o;____/______/______/____
/______/______/______/______/____"=._o._; | ;_.--"o.--"_/______/______/______/_
____/______/______/______/______/_____"=.o|o_.--""___/______/______/______/____
/______/______/______/______/______/______/______/______/______/______/_____ /
*******************************************************************************
'''
wait_on_boat = '''
You panic and look everywhere for help.
Then you see an island in the distance.
The boat is strong enough to take you to the island.
'''
shark = "A big shark waiting for you and eat you. \nYou are dead. \nGame over."
swim_or_wait = input('''
You are on a boat.
But something's wrong.
Your feet are wet.
Wait or swim?
(w/s)
''')
found_map = "You've found a map"
not_enter_cave = "Mean crows eat you. \nYou are dead. \nGame over."
lost = "You are desesperate and cry. \nA monster hear you and eat you. \nYou are dead. \nGame over."
found_monster = "You are face to a big monster. \nThe monster eat you. \nYou are dead. \nGame over."
print(boat_image)
if swim_or_wait == 'w':
print(wait_on_boat)
enter_cave = input("You find a cave. Do you enter it? (y/n) \n")
if enter_cave == 'y':
way_chosen = input("left or right? (l/r) \n")
if way_chosen == 'r':
print(map_paper)
print(found_map)
way_chosen = input("Go left, straight or right? (l/s/r) \n")
if way_chosen == 'r':
print(lost)
print(dead)
elif way_chosen == 's':
print(found_monster)
print(dead)
else:
way_chosen = input("Go left, straight or right? (l/s/r) \n")
if way_chosen == 'r':
way_chosen = input("Go left, straight or right? (l/s/r) \n")
if way_chosen == 's':
print("You have found the treasure. \nYou win!")
print(win)
elif way_chosen == 'l':
print(lost)
print(dead)
else:
print(found_monster)
print(dead)
else:
print(lost)
print(dead)
else:
continue_road = input("Continue? (y/n) \n")
if continue_road == 'y':
print("You continue to right. And then...")
way_chosen = input("Go left, straight or right? (l/s/r) \n")
if way_chosen == 'r':
print(map_paper)
print(found_map)
way_chosen = input("Go left, straight, right or back to the last position? (l/s/r/b) \n")
if way_chosen == 'l':
print(found_monster)
print(dead)
elif way_chosen == 's' or way_chosen == 'r':
print(lost)
print(dead)
else:
print("You have the map now. \n")
way_chosen = input("Go left, straight or right? (l/s/r) \n")
if way_chosen == 'l':
print(lost)
print(dead)
elif way_chosen == 'r':
print("You're from there. \nBut now, the monster hear you and comes to eat you. \nYou're dead. \n Game over.")
print(dead)
else:
way_chosen = input("You go straight and found 3 other branches. \nGo left, straight or right? (l/s/r) \n")
if way_chosen == 's':
print("You have found the treasure. \nYou win!")
print(win)
elif way_chosen == 'l':
print(lost)
print(dead)
else:
print(found_monster)
print(dead)
elif way_chosen == 'l':
print(lost)
print(dead)
else:
way_chosen = input("You go straight and found 3 other branches. \nGo left, straight or right? (l/s/r) \n")
if way_chosen == 's':
print("You have found the treasure. \nYou win!")
print(win)
elif way_chosen == 'l':
print(lost)
print(dead)
else:
print(found_monster)
print(dead)
else:
print(lost)
print(dead)
else:
print(not_enter_cave)
print(dead)
else:
print(shark)
print(dead)