Reference · Rolls and exact odds
loadingOffunction
What a loaded die's loading comes to, as exact fractions, for the face it
favours most: { face: 6, loaded: [3, 8], fair: [1, 6] } is "6 comes up 3
in 8, not 1 in 6". Null for a die that is not loaded.
Import it
import { loadingOf } from "@johnmorrisdotca/korokoro";
Definition
function loadingOf(group: DiceGroup): { face: number; loaded: [number, number]; fair: [number, number]; } | null
Parameters
| Name | Type | Description |
|---|---|---|
group | DiceGroup | One kind of dice and its rules. |
Returns
{ face: number; loaded: [number, number]; fair: [number, number]; } | null
What a loaded die's loading comes to, as exact fractions, for the face it favours most: { face: 6, loaded: [3, 8], fair: [1, 6] } is "6 comes up 3 in 8, not 1 in 6". null for a die that is not loaded.
Examples
import { loadingOf } from "@johnmorrisdotca/korokoro";
import { parseNotation } from "@johnmorrisdotca/korokoro";
console.log(loadingOf(parseNotation("1d6{6:3}")!));{ face: 6, loaded: [ 3, 8 ], fair: [ 1, 6 ] }What it prints (run when this page was built)