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

diceWarSpecfunction

The dice a game rolls, as a spec the rest of the package reads.

Import it

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

Definition

function diceWarSpec(game: Pick<DiceWarGame, "dice" | "sides">): RollSpec

Parameters

NameTypeDescription
gamePick<DiceWarGame, "dice" | "sides">

The current Dice War state.

Returns

RollSpec

The dice a game rolls, as a spec the rest of the package reads.

Examples

import { diceWarSpec } from "@johnmorrisdotca/korokoro";
import { formatNotation, startDiceWar } from "@johnmorrisdotca/korokoro";
const game = startDiceWar({ players: ["One", "Two"], computers: [true, true], goal: "rounds", to: 1, seed: "table" })!;
console.log(formatNotation(diceWarSpec(game)));
1d6

What it prints (run when this page was built)

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