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

rollTextfunction

One roll on one line: 2d20kh1+5: 22 [17 (4)], or for a formula (2d6+3)*2: 20 ([6 1]+3)*2.

Import it

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

Definition

function rollText(roll: Roll): string

Parameters

NameTypeDescription
rollRoll

The completed roll to read or record.

Returns

string

One roll on one line: 2d20kh1+5: 22 [17 (4)], or for a formula (2d6+3)*2: 20 ([6 1]+3)*2.

Examples

import { rollText } 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(rollText(sample));
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.