Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7a78288

Browse files
Update program.py
1 parent 7c4cdb9 commit 7a78288

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

‎Dice Roll Simulator/program.py‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,52 @@
1+
import random
2+
3+
4+
x = "y"
5+
6+
while x == "y":
7+
8+
# Gnenerates a random number
9+
# between 1 and 6 (including
10+
# both 1 and 6)
11+
no = random.randint(1,6)
12+
13+
if no == 1:
14+
print("[-----]")
15+
print("[ ]")
16+
print("[ 0 ]")
17+
print("[ ]")
18+
print("[-----]")
19+
if no == 2:
20+
print("[-----]")
21+
print("[ 0 ]")
22+
print("[ ]")
23+
print("[ 0 ]")
24+
print("[-----]")
25+
if no == 3:
26+
print("[-----]")
27+
print("[ ]")
28+
print("[0 0 0]")
29+
print("[ ]")
30+
print("[-----]")
31+
if no == 4:
32+
print("[-----]")
33+
print("[0 0]")
34+
print("[ ]")
35+
print("[0 0]")
36+
print("[-----]")
37+
if no == 5:
38+
print("[-----]")
39+
print("[0 0]")
40+
print("[ 0 ]")
41+
print("[0 0]")
42+
print("[-----]")
43+
if no == 6:
44+
print("[-----]")
45+
print("[0 0 0]")
46+
print("[ ]")
47+
print("[0 0 0]")
48+
print("[-----]")
49+
50+
x=input("press y to roll again and n to exit:")
51+
print("\n")
152

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /