Created
March 23, 2018 22:15
-
-
Save sleibrock/5639170751eae236d142c49c79819b2d to your computer and use it in GitHub Desktop.
Character weight table generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# character thing | |
weight_table = [ | |
(100, "Humans"), | |
(50, "Elves"), | |
(25, "Dragonborn"), | |
(20, "Changeling"), | |
] | |
def create_roll_table(): | |
"""do a thing""" | |
sum_weights = sum([d[0] for d in weight_table]) | |
print("Max weight: {}".format(sum_weights)) | |
starting_index = 1 | |
for race in weight_table: | |
print("[{}-{}] {}".format( | |
starting_index, | |
(race[0]-1)+starting_index, | |
race[1] | |
)) | |
starting_index += race[0] | |
return | |
create_roll_table() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment