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

Exportedtype

A whole JSON export.

Import it

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

Definition

type Exported = {
    format: typeof EXPORT_FORMAT;
    generator: string;
    rolls: ExportedRoll[];
    stats?: Stats;
};

Members

NameTypeDescription
format1
generatorstring
rollsExportedRoll[]
stats (optional)Stats | undefined

Examples

import type { Exported } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, rollFrom, toJSON } from "@johnmorrisdotca/korokoro";
const value: Exported = JSON.parse(toJSON([rollFrom(DEFAULT_SPEC, [2, 5], "saved", 0, null)!]));
console.log(value.format);
1

What it prints (run when this page was built)

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