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

DiceWarThrowtype

One throw of the table: everybody who had to roll, in seat order, the war it was in (0 for the round's first throw), the seats that tied for highest, and who took the stake: null where the throw was a tie and the war goes on, or the round was called off.

Import it

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

Definition

type DiceWarThrow = {
    round: number;
    war: number;
    rolls: DiceWarRoll[];
    tied: number[];
    winner: number | null;
    stake: number;
};

Members

NameTypeDescription
roundnumber
warnumber
rollsDiceWarRoll[]
tiednumber[]
winnernumber | null
stakenumber

Examples

import type { DiceWarThrow } from "@johnmorrisdotca/korokoro";
import { startDiceWar, playDiceWar } from "@johnmorrisdotca/korokoro";
const value: DiceWarThrow = playDiceWar(startDiceWar({ players: ["One", "Two"], computers: [true, true], seed: "docs" })!, {})!.throws[0]!;
console.log(value.round);
1

What it prints (run when this page was built)

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