Reference · Rolls and exact odds
groupTotalsfunction
What each kind of dice of a roll came to, in order: what a formula puts together.
Import it
import { groupTotals } from "@johnmorrisdotca/korokoro";
Definition
function groupTotals(roll: Roll): number[]
Parameters
| Name | Type | Description |
|---|---|---|
roll | Roll | The completed roll to read or record. |
Returns
number[]
What each kind of dice of a roll came to, in order: what a formula puts together.
Examples
import { groupTotals } 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(groupTotals(sample));[ 7 ]What it prints (run when this page was built)