Skip to content

Instantly share code, notes, and snippets.

@sleibrock
Created March 23, 2018 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sleibrock/5639170751eae236d142c49c79819b2d to your computer and use it in GitHub Desktop.
Save sleibrock/5639170751eae236d142c49c79819b2d to your computer and use it in GitHub Desktop.
Character weight table generator
# 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