Skip to the content

Korokoroコロコロ

Roll mixed dice or type notation, compare exact probabilities, keep a history and replay seeded rolls.

Korokoro describes something small rolling in Japanese. About the name

Contents

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

NameTypeDescription
groupDiceGroup

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/korokoro 1.16.0.