Reference · Rolls and exact odds
groupOffunction
The kind of dice one die of a roll belongs to, with its rules, faces and weights.
Import it
import { groupOf } from "@johnmorrisdotca/korokoro";
Definition
function groupOf(spec: RollSpec, die: DieRoll): DiceGroup
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
DiceGroup
The kind of dice one die of a roll belongs to, with its rules, faces and weights.
Examples
import { groupOf } 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(groupOf(spec, diceOf(sample)[0]!).sides);6What it prints (run when this page was built)