Reference · Rolls and exact odds
keptCountfunction
How many dice of one group count towards the total. For a roll of several kinds, ask each of groupsOf.
Import it
import { keptCount } from "@johnmorrisdotca/korokoro";
Definition
function keptCount(group: DiceGroup): number
Parameters
| Name | Type | Description |
|---|---|---|
group | DiceGroup | One kind of dice and its rules. |
Returns
number
How many dice of one group count towards the total. For a roll of several kinds, ask each of groupsOf.
Examples
import { keptCount } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(keptCount(parseNotation("4d6kh3")!));3What it prints (run when this page was built)