commit f207b1c9b55bc7cd12661bdccd1f1da7bbe7a26c Author: Matt Huntington Date: Sun Aug 29 13:03:50 2021 -0400 prints all point buy possibilities diff --git a/.ability_score_maximizer.py.swp b/.ability_score_maximizer.py.swp new file mode 100644 index 0000000..7a43dba Binary files /dev/null and b/.ability_score_maximizer.py.swp differ diff --git a/ability_score_maximizer.py b/ability_score_maximizer.py new file mode 100644 index 0000000..f713a8c --- /dev/null +++ b/ability_score_maximizer.py @@ -0,0 +1,52 @@ +score_to_points = { + 15:9, + 14:7, + 13:5, + 12:4, + 11:3, + 10:2, + 9:1, + 8:0 + } +abilities = ['strength', 'dexterity', 'constitution', 'intelligence', 'wisdom', 'charisma'] +ability_scores = {} + +def check_scores(scores): + total = 0 + for score in scores.values(): + total += score_to_points[score] + if total == 27: + return True + else: + return False + +def set_score(ability_index): + if ability_index > 5: + if check_scores(ability_scores): + print(ability_scores) + else: + for score in score_to_points: + ability_scores[abilities[ability_index]] = score + set_score(ability_index+1) + +set_score(0) + + +# for score in score_to_points: + # ability_scores[abilities[0]] = score + # for score in score_to_points: + # ability_scores[abilities[1]] = score + # for score in score_to_points: + # ability_scores[abilities[2]] = score + # for score in score_to_points: + # ability_scores[abilities[3]] = score + # for score in score_to_points: + # ability_scores[abilities[4]] = score + # for score in score_to_points: + # ability_scores[abilities[5]] = score + # if check_scores(ability_scores): + # # True + # print(ability_scores) + +# for score in score_to_points: + # print(score)