Reference · Rolls and exact odds
ExactCountstype
The odds as whole numbers: how many of the equally likely outcomes make each total.
Import it
import type { ExactCounts } from "@johnmorrisdotca/korokoro";
Definition
type ExactCounts = {
min: number;
counts: bigint[];
outcomes: bigint;
};
Members
| Name | Type | Description |
|---|---|---|
min | number | The lowest total the dice can make. |
counts | bigint[] | counts[i] is the number of outcomes that total min + i. |
outcomes | bigint | How many outcomes there are: the sides to the power of the dice. |
Examples
import type { ExactCounts } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, exactCounts } from "@johnmorrisdotca/korokoro";
const value: ExactCounts = exactCounts(DEFAULT_SPEC)!;
console.log(String(value.outcomes));36What it prints (run when this page was built)