Reference · Rolls and exact odds
chanceAtLeastfunction
The chance of this total or more: "what do I need to beat a DC of 15".
Import it
import { chanceAtLeast } from "@johnmorrisdotca/korokoro";
Definition
function chanceAtLeast(spec: Odds, target: 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. |
Returns
number
The chance of this total or more: "what do I need to beat a DC of 15".
Examples
import { chanceAtLeast } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(chanceAtLeast(spec, 10));0.16666666666666669What it prints (run when this page was built)