-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex35.py
59 lines (47 loc) · 1.43 KB
/
ex35.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
from sys import exit
def gold_room():
print("This room is full of gold. How much do you take?")
choice = input('> ')
if '0' in choice or '1' in choice:
how_much = int(choice)
else:
dead("Man, learn how to type a number.")
if how_much < 50:
print("Nice, you're not greedy, you win!")
exit(0)
else:
print("You greedy bastard!")
def bear_room():
print("There is a bear here.\nThe bear has a bunch of honey.\nThe fat bear is in front of a door.\nHow are you going to move the bear?\n(Hint: Kill or be killed)")
choice = input("> ")
if "kill" in choice:
print("The bear is now dead and you can go through the door. You open the door and find that...")
gold_room()
else:
dead("You died because you did not take my advice and kill the bear.")
def cthulu_room():
print("Here you see the great evil Cthulu.")
print("He, it, whatever, stares at you and you go insane.")
print("Do you flee for your life or eat your own head?")
choice = input('> ')
if "flee" in choice:
start()
elif "head" in choice:
dead("Well, that was tasty!")
else:
cthulu_room()
def dead(why):
print(why, "Good Job!")
exit(0)
def start():
print("You are in a dark room.")
print("There is a door to your left and a door to your right.")
print("Which do you choose?")
choice = input("> ")
if choice == "left":
bear_room()
if choice == "right":
cthulu_room()
else:
dead("You stumble around the room until you starve.")
start()