m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-15 17:49:49 -0400
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2017-07-15 17:50:09 -0400
commitd939daae10c15b00652bf87625d87ad2eed1ce39 (patch)
tree0e1538e11322816dc8927f46df5ddc0482fec6da /src
parentab75ff5d633f1c85b3ac7496e9d22809f461483d (diff)
Handle 0 dice
Diffstat (limited to 'src')
-rw-r--r--src/dice.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dice.js b/src/dice.js
index 5edc892..1587eef 100644
--- a/src/dice.js
+++ b/src/dice.js
@@ -5,7 +5,7 @@ const pool = (die) => {
}
const roll = (die) => {
- return pool(die).reduce((a, b) => (a + b))
+ return pool(die).reduce((a, b) => (a + b), 0)
}
const d = (number, sides) => {