diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-11 15:47:50 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-11 15:47:50 -0400 |
commit | 9368b1c33db290d7c80c93db5c867cdb7fcaf14d (patch) | |
tree | c6170c157985624b373a13bb540bd4070321c18c /src/dice.js | |
parent | da6582f328c17e1842a4632d88e06d851e7c4b5f (diff) |
Implement collecting
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 |