Reference · Rules, games and records
rollFromfunction
A roll of count dice from a source.
Import it
import { rollFrom } from "@johnmorrisdotca/sugoroku";
Definition
function rollFrom(source: DiceSource, count?: number): number[]
Parameters
| Name | Type | Description |
|---|---|---|
source | DiceSource | A die source returning a valid integer from 1 to 6. |
count (optional) | number | The number of dice to throw. |
Returns
number[]
A roll of count dice from a source.
Examples
import { rollFrom, seededDice } from "@johnmorrisdotca/sugoroku";
console.log(rollFrom(seededDice(42),2));[ 4, 3 ]What it prints (run when this page was built)