+ 1
How to create a dice for ludo
The dice should roll a random number between range (1,6) and if it's 6 it should roll a random number again and if it's 3 6's in a row then stop.
5 Antworten
+ 5
Show us your attempt first, then we can help you.
+ 1
import random
min = 1
max = 6
value = (random.randint(min,max))
print(value)
while (value) == max:
print("Rolling again...")
print(random.randint(min,max))
break
+ 1
i could only get it to roll twice and i am stuck here
+ 1
import random
min = 1
max = 6
value = (random.randint(min,max))
print(value)
while (value) == max:
print("Rolling again...")
value = (random.randint(min,max))
print(value)
if value == 6:
print("Rolling again")
value = (random.randint(min,max))
print(value)
elif value == 6:
print("Oops")
else:
print("Nice")
so i made these changes and it seems to work? lol idk for sure coz i tried rolling a couple times but never got 3 6's lol... anyway thanks alot for ur help Rowsej.