Reference · Rolls and exact odds
expectedTotalfunction
The average total over many rolls.
Import it
import { expectedTotal } from "@johnmorrisdotca/korokoro";
Definition
function expectedTotal(spec: Odds): number
Parameters
| Name | Type | Description |
|---|---|---|
spec | Odds | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
Returns
number
The average total over many rolls.
Examples
import { expectedTotal } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(expectedTotal(spec));7What it prints (run when this page was built)