-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRandomgame.py
More file actions
49 lines (44 loc) · 1.44 KB
/
Copy pathRandomgame.py
File metadata and controls
49 lines (44 loc) · 1.44 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
import random, sys, time
from colorama import Fore,Style,init
init(autoreset=True)
print(Fore.LIGHTCYAN_EX + "="*35)
print(Fore.MAGENTA + "WELCOME TO LUCK ROLL")
print(Fore.LIGHTCYAN_EX + "="*35)
def loading():
for i in range(2):
for j in range(3):
sys.stdout.write('\r')
sys.stdout.write(Fore.LIGHTBLUE_EX + "Loading" + "."*(j+1))
sys.stdout.flush()
time.sleep(0.5)
print()
def main():
a = int(input(Fore.YELLOW + "Enter a number between 1-10\n"))
if (a>1 and a<11) :
selected = random.choice([3,6,8])
if(a==selected):
loading()
print(Fore.LIGHTCYAN_EX+"="*35)
if(a==3):
print(Fore.RED +"You Win!! 100$")
elif(a==6):
print(Fore.RED + "You WIN!! 1000$")
elif(a==8):
print(Fore.RED + "You WIN!! 2000$")
print(Fore.LIGHTCYAN_EX+"="*35)
input(Fore.CYAN+"Press Enter to continue...")
else:
loading()
print(Fore.LIGHTCYAN_EX+"="*35)
print(Fore.RED+"OOPPSS! Try Next Time")
print(Fore.LIGHTCYAN_EX+"="*35)
main()
while True:
p = input("Do you want to play again?(Yes/No)\n")
if p == "Yes":
main()
elif p == "No":
print("Thank You for playing")
break
else:
print("Enter Correctly! Type Yes or No only.")