replace dice sanity checks as asserts
This commit is contained in:
parent
c2aa3df13f
commit
b917f78ca5
@ -93,12 +93,8 @@ class DiceRoller(object):
|
||||
size = m[1]
|
||||
if keep > dice or keep == 0:
|
||||
keep = dice
|
||||
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
|
||||
assert size >= 1, f"Die must have at least one side."
|
||||
assert dice >= 1, f"At least one die must be rolled."
|
||||
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