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

toTextfunction

Rolls as plain text, one to a line, each with its time in UTC, oldest first as given.

Import it

import { toText } from "@johnmorrisdotca/korokoro";

Definition

function toText(rolls: readonly Roll[]): string

Parameters

NameTypeDescription
rollsreadonly Roll[]

Completed rolls, or the number of attempts where this parameter is numeric.

Returns

string

Rolls as plain text, one to a line, each with its time in UTC, oldest first as given.

Examples

import { toText } from "@johnmorrisdotca/korokoro";
import { normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(toText([sample]));
1970-01-01T00:00:00.000Z  2d6: 7  [2 5]

What it prints (run when this page was built)

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