diff options
Diffstat (limited to 'src/dice.js')
-rw-r--r-- | src/dice.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dice.js b/src/dice.js index abe3c4b..d47455e 100644 --- a/src/dice.js +++ b/src/dice.js @@ -50,6 +50,12 @@ const multiply = (die1, die2) => { } } +const divide = (die1, die2) => { + return () => { + return [() => Math.floor(roll(die1) / roll(die2))] + } +} + const bonusAdd = (die1, die2) => { return () => { return die1().map(die => { @@ -194,6 +200,7 @@ exports.d = d exports.add = add exports.subtract = subtract exports.multiply = multiply +exports.divide = divide exports.bonusAdd = bonusAdd exports.bonusSubtract = bonusSubtract exports.negative = negative |