-
Notifications
You must be signed in to change notification settings - Fork 0
/
Diceroll.py
24 lines (21 loc) · 920 Bytes
/
Diceroll.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
import random
MIN = 1 #set lowest vlaue of the dice roll
MAX = 6 #set highest vlaue of the dice roll
DICE = 1 #set how many dice are rolled
ROLLAGAIN = "y" #continue playing if starting with y
while ROLLAGAIN.startswith('y'):
#ask the user to input the highest value of the dice
MAX = int(input("How many sides on the di?"))
#ask the user to set how many dice are rolled
DICE = int(input("How many dice do you want to Roll?"))
print ("Rolling the dice")
print ("You rolled...")
count = 0
#while loop repeats roll for how many dice are set
while True:
print (random.randint(MIN, MAX))
count += 1
if count >= DICE:
break
#ask user if they want to roll again
ROLLAGAIN = input("Roll again?").lower()