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:
parent
f43b9e4de4
commit
994f9ef50b
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user