-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
123 lines (94 loc) · 4.26 KB
/
main.py
File metadata and controls
123 lines (94 loc) · 4.26 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
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
START_LOCATION = "Entrance"
ENTRANCE = '''
You are in the Entrance!
The entrance is a small driveway that can lead you to the following directions:
Magic Kingdom: Going straight is a fairy tale world.
Jurassic Park: To your right and elevator that can take you down to a location where dinosaurs are still real (be careful if choosing this one..)'''
MAGIC_KINGDOM = '''
There are many things to do here,
You can on rides, be a princess or a prince, just have fun!
Your next possible destinations are:
Universal Studio: Right in the hole in the corner the extreme amusement park.
Alaska: To your right there is a door that will take you to a freezing world.
Entrance: You can go back and be at your starting point'''
UNIVERSAL_STUDIO = '''
You can get on as many rides as you want, but be careful and be sure you meet all requirements!
Your next possible destinations are:
Magic Kingdom: Go back to through the small hole in the corner.
Alaska: To your right there is the door that will take you to the freezing world.'''
ALASKA = '''
I hope your brought a coat because is freezing in here, hope you make penguin frineds!!
Your next possible destinations are:
Magic Kingdom: Is to your left and is going to be the only way to get back to the entrance.
Jurassic Park: Take the elevator and it will take to the dinosour underworld.
Universal Studio: To your right you are able to go back to Universal Studio. '''
JURASSIC_PARK = '''
Welcome back to the world where dinosaurs still exist, be careful out here.
Your next possible destinations are:
Amazon River: To your left there is a boat waiting on you that will take you swimming to the river
(be careful an animal could kill you and the tour will be over).
Animal Kingdom: To your right is a golf cart that will tour you around the forest.
'''
AMAZON_RIVER = '''
Welcome, hope you know to to swim...
There is no exit out the river you will have to stay here an survive until someone finds you.
'''
ANIMAL_KINGDOM = '''
You are trapped and there is no exit out! Time to showw off your survival skills.'''
def location_print(location:str) -> None:
if location == "Entrance":
print(ENTRANCE)
elif location == "Magic Kingdom":
print(MAGIC_KINGDOM)
elif location == "Universal Studio":
print(UNIVERSAL_STUDIO)
elif location == "Alaska":
print(ALASKA)
elif location == "Jurassic Park":
print(JURASSIC_PARK)
elif location == "Amazon River":
print(AMAZON_RIVER)
elif location == "Animal Kingdom":
print(ANIMAL_KINGDOM)
def valid_destination(location:str, destination:str) -> bool:
if location == "Entrance":
return destination == "Magic Kingdom" or destination == "Jurassic Park"
elif location =="Magic Kingdom":
return destination == "Universal Studio" or destination == "Alaska" or destination == "Entrance"
elif location == "Universal Studio":
return destination == "Magic Kingdom" or destination == "Alaska"
elif location == "Alaska":
return destination == "Universal Studio" or destination == "Magic Kingdom" or destination == "Jurassic Park"
elif location == "Jurassic Park":
return destination == "Amazon River" or destination == "Animal Kingdom"
elif location == "Amazon River":
return False
elif location == "Animal Kingdom":
return False
else:
return False
def invalid_destination(location:str , destination:str) -> str:
return f"You can't acces {destination} from {location}"
def user_choice_or_quit(location:str) -> str:
while True:
print("Where would you like to go?! Press [q] to exit the program. ")
destination = input("> ")
if destination == "q" or valid_destination(location, destination):
return destination
else:
print(invalid_destination(location, destination))
def main()-> None:
location = START_LOCATION
while True:
location_print(location)
destination = user_choice_or_quit(location)
if destination == "q":
break
elif destination == "Amazon River" or destination == "Animal Kingdom":
location = destination
location_print(location)
break
else:
location = destination
if __name__ == '__main__':
main()