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

DiceWarOptionstype

What a game of Dice War is set up with. Everything but the players is optional.

Import it

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

Definition

type DiceWarOptions = {
    players: readonly string[];
    computers?: readonly boolean[];
    dice?: number;
    sides?: number;
    goal?: DiceWarGoal;
    to?: number;
    seed?: string;
};

Members

NameTypeDescription
playersreadonly string[]

One name a seat. Two to eight.

computers (optional)readonly boolean[] | undefined

One a seat: true where a computer rolls. A seat not given is a person's, whose dice are handed in.

dice (optional)number | undefined

How many dice each player rolls, added up: 1 unless said, up to DICE_WAR_LIMITS.mostDice.

sides (optional)number | undefined

How many sides each die has, 2 to 1000: 6 unless said.

goal (optional)DiceWarGoal | undefined

"points", played to a score (unless said), or "rounds", played for a number of rounds.

to (optional)number | undefined

The score to play to, or the number of rounds: 5 unless said.

seed (optional)string | undefined

The seed the computers' dice come from, any text: a fresh one unless said.

Examples

import type { DiceWarOptions } from "@johnmorrisdotca/korokoro";
const value: DiceWarOptions = { players: ["One", "Two"], computers: [true, true], seed: "docs" };
console.log(value.players.length);
2

What it prints (run when this page was built)

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