UNPKG

579 BMarkdownView Raw
1# dice
2
3```js
4// usage
5chance.d4()
6chance.d6()
7chance.d8()
8chance.d10()
9chance.d12()
10chance.d20()
11chance.d30()
12chance.d100()
13```
14
15<p class="pullquote" data-pullquote='"Any dungeon master worth his weight in geldings goes nowhere without his 20 sided die."' markdown="1"></p>
16
17Return a value equal to the roll of a die.
18
19```js
20chance.d20();
21=> 13
22
23chance.d6();
24=> 4
25```
26
27These are just wrappers around natural() but are convenient for use by games.
28
29They return values between 1 and the number after the `d`, so `chance.d4()` returns 1, 2, 3, or 4, just like a 4 sided die would.