Reference · Rolls and exact odds
canHoldfunction
Whether some dice of a roll can be held while the rest are thrown again: plain dice only, none rerolled, exploding, kept or dropped, counted, raised, lowered or sorted.
Import it
import { canHold } from "@johnmorrisdotca/korokoro";
Definition
function canHold(spec: RollSpec): boolean
Parameters
| Name | Type | Description |
|---|---|---|
spec | RollSpec | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
Returns
boolean
Whether some dice of a roll can be held while the rest are thrown again: plain dice only, none rerolled, exploding, kept or dropped, counted, raised, lowered or sorted.
Examples
import { canHold } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(canHold(spec));trueWhat it prints (run when this page was built)