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

Presettype

The dice for a game, and how the game reads them. A preset is data: a line here, not code. Korokoro rolls and reads the dice; it does not run the game (whose turn it is, a score sheet across rounds).

Import it

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

Definition

type Preset = {
    id: string;
    name: string;
    nameJa: string;
    aliases: string[];
    family: GameFamily;
    notation: string;
    reading: ReadingId;
    options?: Record<string, number>;
    total: boolean;
    rolls?: number;
    hold?: false;
    runs?: true;
    says: string;
    saysJa: string;
    how: string;
    source?: string;
};

Members

NameTypeDescription
idstring

A short name for code, links and the command line: "yahtzee", "cho-han".

namestring

What people call the game.

nameJastring

The same in Japanese, for the tray.

aliasesstring[]

Other names it is found by: an older or public-domain name, a name in another language.

familyGameFamily
notationstring

The dice, as notation.

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"

How a roll is read: one of the named readings.

options (optional)Record<string, number> | undefined

Figures a reading needs: a pool's target number, a game's main.

totalboolean

Whether the total is what matters. False where the reading is the result, as in Yahtzee or chō-han.

rolls (optional)number | undefined

How many rolls a turn has when dice are held between them: 3 for Yahtzee. Left out when a turn is one roll.

hold (optional)false | undefined

False where holding a die and rolling the rest is no part of the game, as in craps or Monopoly: the tray then holds nothing. Left out where dice are held between rolls (Yahtzee, Farkle).

runs (optional)true | undefined

True where a roll is read in the light of the rolls before it: the point in craps, a turn's total in Pig.

saysstring

What it is, in a line.

saysJastring

The same in Japanese.

howstring

How the dice are used in the game, in a few sentences of our own.

source (optional)string | undefined

Where the rule can be read. Left out of a preset that has no rule to cite, such as a coin.

Examples

import type { Preset } from "@johnmorrisdotca/korokoro";
import { getPreset } from "@johnmorrisdotca/korokoro";
const value: Preset = getPreset("cho-han")!;
console.log(value.notation);
2d6

What it prints (run when this page was built)

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