-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dice_Rolling_Simulator.py
60 lines (49 loc) · 1.31 KB
/
Dice_Rolling_Simulator.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
import random
import time
def roll():
dice = ["1","2","3","4","5","6"]
roll_dice = random.choice(dice)
# print(roll_dice)
time.sleep(0.5)
if roll_dice == "1":
print("[-------]")
print("[---0---]")
print("[-------]")
elif roll_dice == "2":
print("[0------]")
print("[-------]")
print("[------0]")
elif roll_dice == "3":
print("[0------]")
print("[---0---]")
print("[------0]")
elif roll_dice == "4":
print("[0-----0]")
print("[-------]")
print("[0-----0]")
elif roll_dice == "5":
print("[0-----0]")
print("[---0---]")
print("[0-----0]")
elif roll_dice == "6":
print("[0-----0]")
print("[0-----0]")
print("[0-----0]")
else:
print("Invalid Input")
def dice_game():
flag = True
while flag:
print(" ")
print("----------Welcome To The Dice Rolling Game-------------")
print(" ")
print(" ")
print("-----Want To Roll The Dice: ")
user_input = input('''Enter Y To Roll The Dice
Enter E To Exit ''').lower()
if user_input == 'y':
roll()
else:
print("Exiting.........")
break
dice_game()