My program rolls n die depending on input however only ever does on at a time. tried making it go back to d20() with another one in the if but doesn#t seem to do anything.
import random
min = 1;
print "1. d20 \n2. d12 \n3. d10 \n4. d8 \n5. d6 \n6. d \n7. d100"
command = raw_input("Function: ")
def d20(n):
done = 0
if n>done:
print random.randint(min, 20)
done = done + 1
elif n==done :
print 'finished'
if command == "d20" or command == "1":
die = raw_input("How many die? ")
int(die)
d20(die)
else:
print 'else'
Aucun commentaire:
Enregistrer un commentaire