Reference · Rolls and exact odds
FaceChancetype
One face of a die and how often it comes up, beside how often it would on a fair one.
Import it
import type { FaceChance } from "@johnmorrisdotca/korokoro";
Definition
type FaceChance = {
face: number;
label: string;
chance: number;
fair: number;
};
Members
| Name | Type | Description |
|---|---|---|
face | number | The face, as a roll records it. |
label | string | What it says, on a custom die; its number otherwise. |
chance | number | Its chance on this die. |
fair | number | Its chance if every face were as likely as the next. |
Examples
import type { FaceChance } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, faceChances } from "@johnmorrisdotca/korokoro";
const value: FaceChance = faceChances(DEFAULT_SPEC)[0]!;
console.log(value.chance);0.16666666666666666What it prints (run when this page was built)