-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGhost.py
More file actions
22 lines (22 loc) · 712 Bytes
/
Ghost.py
File metadata and controls
22 lines (22 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from random import randint
print ("Ghost Game")
feeling_brave = True
score = 0
while feeling_brave:
ghost_door = randint(1,3)
print("--------------------------------------------------------")
print("Three doors ahead")
print("A ghost behind one.")
print("Which door do you open?")
door = input("1, 2 or 3? ")
door_num = int(door)
if door_num == ghost_door:
print("GHOST!")
feeling_brave = False
else:
score = score + 1
print("No ghost!")
print("You enter the next room")
print(f"Your score is now {score} and you're entering the next room...")
print("Run away!")
print(f"Game over! You scored {score}, which is OK, I suppose.")