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

TypedResultstype

What readResults found in somebody's typed results.

Import it

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

Definition

type TypedResults = {
    ok: true;
    sides: number;
    counts: number[];
    rolls: number;
} | {
    ok: false;
    part: string;
};

Examples

import type { TypedResults } from "@johnmorrisdotca/korokoro";
import { readResults } from "@johnmorrisdotca/korokoro";
const value: TypedResults = readResults("1 2 3 4 5 6", 6);
console.log(value.ok);
true

What it prints (run when this page was built)

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