diff options
Diffstat (limited to 'src/dice.js')
-rw-r--r-- | src/dice.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dice.js b/src/dice.js index 0197f25..1e15937 100644 --- a/src/dice.js +++ b/src/dice.js @@ -222,6 +222,10 @@ const repeat = (die1, die2) => { } } +const collect = die => { + return () => [() => roll(die)] +} + exports.pool = pool exports.roll = roll exports.constant = constant @@ -244,3 +248,4 @@ exports.againUnder = againUnder exports.thresholdHigh = thresholdHigh exports.thresholdLow = thresholdLow exports.repeat = repeat +exports.collect = collect |