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

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

NameTypeDescription
facenumber

The face, as a roll records it.

labelstring

What it says, on a custom die; its number otherwise.

chancenumber

Its chance on this die.

fairnumber

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.16666666666666666

What it prints (run when this page was built)

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