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

runClifunction

Run the command line. See koro --help for what it takes. One seed serves the whole run: the rolls are drawn from it one after another, in the order asked for, so the same command prints the same dice.

Import it

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

Definition

function runCli(args: readonly string[], around?: CliSurroundings): CliResult

Parameters

NameTypeDescription
argsreadonly string[]

Command-line arguments, without the executable name.

around (optional)CliSurroundings

Environment, locale, clock and input supplied by the host.

Returns

CliResult

Run the command line. See koro --help for what it takes. One seed serves the whole run: the rolls are drawn from it one after another, in the order asked for, so the same command prints the same dice.

Examples

import { runCli } from "@johnmorrisdotca/korokoro";
console.log(runCli(["2d6", "--seed", "table"]).code);
0

What it prints (run when this page was built)

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