diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-07-15 17:49:49 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-07-15 17:50:09 -0400 |
commit | d939daae10c15b00652bf87625d87ad2eed1ce39 (patch) | |
tree | 0e1538e11322816dc8927f46df5ddc0482fec6da /src | |
parent | ab75ff5d633f1c85b3ac7496e9d22809f461483d (diff) |
Handle 0 dice
Diffstat (limited to 'src')
-rw-r--r-- | src/dice.js | 2 |
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) => { |