Reference · Rolls and exact odds
chanceAnyAtLeastfunction
The chance that at least one of several throws of a roll reaches a target: a set of six ability scores holding at least one 16, say.
Import it
import { chanceAnyAtLeast } from "@johnmorrisdotca/korokoro";
Definition
function chanceAnyAtLeast(spec: Odds, target: number, times: number): number
Parameters
| Name | Type | Description |
|---|---|---|
spec | Odds | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
target | number | The DOM host, or the target total for a probability calculation. |
times | number | The number of independent repeats. |
Returns
number
The chance that at least one of several throws of a roll reaches a target: a set of six ability scores holding at least one 16, say.
Examples
import { chanceAnyAtLeast } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(chanceAnyAtLeast(spec, 10, 3));0.4212962962962965What it prints (run when this page was built)