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

playDiceWarfunction

The game after this move, or null for one the rules refuse: the game is over, a person's dice are missing or are not dice of this game, or dice are handed in for a seat that does not roll them.

Import it

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

Definition

function playDiceWar(game: DiceWarGame, move: DiceWarMove): DiceWarGame | null

Parameters

NameTypeDescription
gameDiceWarGame

The current Dice War state.

moveDiceWarMove

Human faces for the seats that currently roll.

Returns

DiceWarGame | null

The game after this move, or null for one the rules refuse: the game is over, a person's dice are missing or are not dice of this game, or dice are handed in for a seat that does not roll them.

Examples

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

What it prints (run when this page was built)

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