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

readDiceAsfunction

Read a roll the way a reading does, with the rolls before it in the same game where that matters.

Import it

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

Definition

function readDiceAs(reading: ReadingId, roll: Roll, before?: readonly Roll[], options?: Record<string, number>): Outcome

Parameters

NameTypeDescription
reading"successes" | "faces" | "sum" | "doubles" | "robber" | "backgammon" | "sixAgain" | "cowries" | "craps" | "hazard" | "yahtzee" | "pokerDice" | "farkle" | "scores" | "bunco" | "pig" | "counts" | "shipCaptainCrew" | "shutTheBox" | "mexico" | "sicBo" | "choHan" | "chinchirorin" | "risk" | "highest" | "d20" | "fate" | "bladesPool" | "pbta" | "hitsAndGlitch" | "percentile" | "rollUnder" | "d66"

The named game reading to apply.

rollRoll

The completed roll to read or record.

before (optional)readonly Roll[]

Earlier rolls needed by a reading with a running result.

options (optional)Record<string, number>

Options for this call; omitted fields keep their documented defaults.

Returns

Outcome

Read a roll the way a reading does, with the rolls before it in the same game where that matters.

Examples

import { readDiceAs } from "@johnmorrisdotca/korokoro";
import { getPreset, normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const preset = getPreset("cho-han")!;
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(readDiceAs(preset.reading, sample).outcome);
han

What it prints (run when this page was built)

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