Skip to content

Commit d398b0f

Browse files
ItsAakiftechyminati
authored andcommitted
Add dice simulator
1 parent c83d43c commit d398b0f

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

‎DiceSimulator.py‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import random
2+
3+
user = input("Do you want to roll the dice ")
4+
5+
while user == "y":
6+
7+
k = random.randint(1,6)
8+
9+
if k == 1:
10+
print(" --------- ")
11+
print("| |")
12+
print("| 0 |")
13+
print("| |")
14+
print(" --------- ")
15+
16+
if k == 2:
17+
print(" --------- ")
18+
print("| 0 |")
19+
print("| |")
20+
print("| 0 |")
21+
print(" --------- ")
22+
23+
if k == 3:
24+
print(" --------- ")
25+
print("| 0 |")
26+
print("| 0 |")
27+
print("| 0 |")
28+
print(" --------- ")
29+
30+
if k == 4:
31+
print(" --------- ")
32+
print("| 0 0 |")
33+
print("| |")
34+
print("| 0 0 |")
35+
print(" --------- ")
36+
37+
if k == 5:
38+
print(" --------- ")
39+
print("| 0 0 |")
40+
print("| 0 |")
41+
print("| 0 0 |")
42+
print(" --------- ")
43+
44+
if k == 6:
45+
print(" ---------- ")
46+
print("| 0 0 |")
47+
print("| 0 0 |")
48+
print("| 0 0 |")
49+
print(" ---------- ")
50+
51+
user = input("Do you want to roll again the dice ")

0 commit comments

Comments
 (0)