-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiple_die_roll.py
More file actions
50 lines (47 loc) · 1.73 KB
/
multiple_die_roll.py
File metadata and controls
50 lines (47 loc) · 1.73 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
import random
''' ● ┌ ─ ┐ │ └ ┘ '''
'''Ascii codes for above symbols : \u25CF \u250C \u2500 \u2510 \u2502 \u2514 \u2518 '''
roll = ( ('┌─────────┐',
'│ │',
'│ ● │',
'│ │',
'└─────────┘' ),
('┌─────────┐',
'│ ● │',
'│ │',
'│ ● │',
'└─────────┘' ),
('┌─────────┐',
'│ ● │',
'│ ● │',
'│ ● │',
'└─────────┘' ),
('┌─────────┐',
'│ ● ● │',
'│ │',
'│ ● ● │',
'└─────────┘' ),
('┌─────────┐',
'│ ● ● │',
'│ ● │',
'│ ● ● │',
'└─────────┘' ),
('┌─────────┐',
'│ ● ● │',
'│ ● ● │',
'│ ● ● │',
'└─────────┘' ) )
roll_die = True
number_of_dice = int(input('Number of dices do you want to roll at a time : '))
while roll_die:
player = input('Do you want to roll the dice (y/n) : ')
if player.lower() == 'y':
for _ in range(number_of_dice):
number = random.choice(roll)
for val in number:
print(val)
elif player.lower() == 'n':
print('Thank you for using the dice')
roll_die = False
else :
print('Enter either y/n !!!')