Reference · Rolls and exact odds
groupsOffunction
The kinds of dice in a roll, in order: the spec's own first, then the rest.
Import it
import { groupsOf } from "@johnmorrisdotca/korokoro";
Definition
function groupsOf(spec: RollSpec): DiceGroup[]
Parameters
| Name | Type | Description |
|---|---|---|
spec | RollSpec | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
Returns
DiceGroup[]
The kinds of dice in a roll, in order: the spec's own first, then the rest.
Examples
import { groupsOf } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(groupsOf(parseNotation("1d6+1d8")!).map((group) => group.sides));[ 6, 8 ]What it prints (run when this page was built)