Reference · Rolls and exact odds
sidesOffunction
The kind of die one die of a roll is.
Import it
import { sidesOf } from "@johnmorrisdotca/korokoro";
Definition
function sidesOf(spec: RollSpec, die: DieRoll): Sides
Parameters
| Name | Type | Description |
|---|---|---|
spec | RollSpec | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
die | DieRoll | The logged die whose group is requested. |
Returns
Sides
The kind of die one die of a roll is.
Examples
import { sidesOf } from "@johnmorrisdotca/korokoro";
import { diceOf, normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(sidesOf(spec, diceOf(sample)[0]!));6What it prints (run when this page was built)