Revert "replace dice sanity checks as asserts"

not sure why I would have done this, asserts are not great

This reverts commit b917f78ca5.

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
Brian S. Stephan 2024-10-31 23:46:18 -05:00
parent f43b9e4de4
commit 994f9ef50b
Signed by: bss
GPG Key ID: 3DE06D3180895FCB

View File

@ -93,8 +93,12 @@ class DiceRoller(object):
size = m[1]
if keep > dice or keep == 0:
keep = dice
assert size >= 1, f"Die must have at least one side."
assert dice >= 1, f"At least one die must be rolled."
if size < 1:
output = "# of sides for die is incorrect: %d" % size
return output
if dice < 1:
output = "# of dice is incorrect: %d" % dice
return output
res = self.roll_dice(keep, dice, size)
curr_str += "%d%s" % (res[0], res[1])
res = res[0]