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

CliResulttype

What the command line came to.

Import it

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

Definition

type CliResult = {
    code: 0 | 1 | 2;
    out: string;
    err: string;
};

Members

NameTypeDescription
code0 | 1 | 2

0 when all went well, 1 when something asked for could not be rolled, 2 when the command itself was wrong.

outstring

For standard output.

errstring

For standard error.

Examples

import type { CliResult } from "@johnmorrisdotca/korokoro";
import { runCli } from "@johnmorrisdotca/korokoro";
const value: CliResult = runCli(["2d6", "--seed", "docs"]);
console.log(value.code);
0

What it prints (run when this page was built)

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