Skip to content

Instantly share code, notes, and snippets.

@CptKirklnd
Created February 10, 2015 02:31
Show Gist options
  • Save CptKirklnd/cf0f7b5169fdf25623df to your computer and use it in GitHub Desktop.
Save CptKirklnd/cf0f7b5169fdf25623df to your computer and use it in GitHub Desktop.
D&D Stat Roller
from random import randint
statList = [] #the stored list of computed ability scores
statConpList = [] #the stored list of the conponents that went into the score
for y in range (0,6):
stat = []
for x in range(0,4):
stat.append(randint(1,6))
#print stat TESTING PURPOSES
statConpList.append(stat)
smallest = stat[0]
for z in range (1,4):
if smallest > stat[z]:
smallest = stat[z]
stat[stat.index(smallest)] = 0
total = 0
for h in range (0,4):
total += stat[h]
#print stat TESTING PURPOSES
statList.append(total)
print statList
input("Press Enter to continue...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment