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

TotalStatstype

The totals of one spec: seen against what the odds promise.

Import it

import type { TotalStats } from "@johnmorrisdotca/korokoro";

Definition

type TotalStats = {
    notation: string;
    rolls: number;
    average: number;
    expected: number;
    highest: number;
    lowest: number;
    min: number;
    seen: number[];
    expectedShare: number[];
};

Members

NameTypeDescription
notationstring

The spec, as notation.

rollsnumber

How many rolls of this spec the history holds.

averagenumber

The mean of their totals; 0 with no rolls.

expectednumber

The mean the odds promise.

highestnumber

The highest total rolled; 0 with no rolls.

lowestnumber

The lowest total rolled; 0 with no rolls.

minnumber

The lowest total the dice can make.

seennumber[]

seen[i] and expected[i] are for a total of min + i.

expectedSharenumber[]

Examples

import type { TotalStats } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, totalStats } from "@johnmorrisdotca/korokoro";
const value: TotalStats = totalStats([], DEFAULT_SPEC);
console.log(value.rolls);
0

What it prints (run when this page was built)

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