m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/dice.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/dice.js')
-rw-r--r--src/dice.js5
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