mardi 22 octobre 2019

D4-D20 dice rolling program

I am a new programmer working on my own project I decided to undertake as a surprise for my D&D group. I want to write a program that can roll dice from D4 to D100 print the out comes and give the total sum of all dice rolled. I was thinking the maximum dice it should roll at a time be 20. But I am stuck before I could really start. even trying to get my program to randomly generate a roll for the D4 doesn't seem to be working. Any advice or tips would be greatly appreciated.

import random

D4 = [1,2,3,4]

D6 = [1,2,3,4,5,6]

D8 = [1,2,3,4,5,6,7,8]

D10 = [1,2,3,4,5,6,7,8,9,10]

D12 = [1,2,3,4,5,6,7,8,9,10,11,12]

D20 = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]

D100 = [10,20,30,40,50,60,70,80,90,00]


dice_choice = (input("Please select your dice:\n"))

while dice_choice is d4:

    print(random.choice(D4))



Aucun commentaire:

Enregistrer un commentaire