Reference · Rolls and exact odds
diceOffunction
The dice of a roll: as recorded, or worked out from its faces for a roll made by hand or by an older version.
Import it
import { diceOf } from "@johnmorrisdotca/korokoro";
Definition
function diceOf(roll: Roll): DieRoll[]
Parameters
| Name | Type | Description |
|---|---|---|
roll | Roll | The completed roll to read or record. |
Returns
DieRoll[]
The dice of a roll: as recorded, or worked out from its faces for a roll made by hand or by an older version.
Examples
import { diceOf } from "@johnmorrisdotca/korokoro";
import { normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(diceOf(sample).length);2What it prints (run when this page was built)