forked from PCMBarber/RandomPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
The Grail.py
64 lines (61 loc) · 1.82 KB
/
The Grail.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
import time
import sys
import random
count = 0
print("You must choose. But choose wisely. For as the True Grail will bring you life -- the False Grail will take it from you.")
while True:
selection = random.randint(5,10)
userinpt = selection + 1
while userinpt == 0 or userinpt >= selection:
if count == 3:
print("He's not the Messiah. He's a very naughty boy")
time.sleep(3)
sys.exit()
count += 1
randomnum = random.randint(1,selection)
print("There are ", selection, "goblets, pick a goblet: ")
try:
userinpt = int(input())
except ValueError:
print("Invalid input")
continue
if userinpt == randomnum:
print("You have chosen")
time.sleep(1)
print(".")
time.sleep(1)
print(".")
time.sleep(1)
print(".")
time.sleep(1)
print("Wisely")
time.sleep(2)
elif userinpt <= 0:
print("Why?")
continue
elif userinpt >= selection:
print("Not an option boyo")
continue
else:
print("You have chosen")
time.sleep(1)
print(".")
time.sleep(1)
print(".")
time.sleep(1)
print(".")
time.sleep(1)
print("Poorly")
time.sleep(2)
print("correct answer: ", randomnum)
answer = input('Play again? (y/n): ')
if answer in ("y", "n", "Y", "N"):
if answer == "y" or answer == "Y":
continue
else:
print ("Goodbye")
sys.exit()
else:
print("I'll take that as a no then")
time.sleep(5)
sys.exit()