-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiceSimulator.py
More file actions
58 lines (49 loc) · 1.34 KB
/
Copy pathDiceSimulator.py
File metadata and controls
58 lines (49 loc) · 1.34 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
50
51
52
53
54
55
56
57
58
'''
When we were kids, we had games to play. But we lost the small dice needed for one game,
so we couldn't play it. Now there's good news we've created an online dice simulator!
Now,no need to worry anymore. We can enjoy the game again!
'''
import random
roll=True
def diceart(dice):
if dice==1:
print(" _______")
print("| |")
print("| o |")
print("|_______|")
elif dice==2:
print(" _______")
print("| |")
print("| o o |")
print("|_______|")
elif dice==3:
print(" _______")
print("| o |")
print("| o |")
print("| o |")
print("|_______|")
elif dice==4:
print(" _______")
print("| o o |")
print("| o o |")
print("|_______|")
elif dice==5:
print(" _______")
print("| o o |")
print("| o |")
print("| o o |")
print("|_______|")
elif dice==6:
print(" _______")
print("| o o o |")
print("| o o o |")
print("| o o o |")
print("|_______|")
while roll:
dice=(random.randint(1,6))
diceart(dice)
rollmoretime=input("Want to roll one more time (y/n):")
if rollmoretime=='y':
roll=True
else:
roll=False