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

diceWarWinnersfunction

The seats that won a game that is over: the player who reached the score, or the most points when the rounds ran out, shared where level. Nobody while it goes on.

Import it

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

Definition

function diceWarWinners(game: DiceWarGame): number[]

Parameters

NameTypeDescription
gameDiceWarGame

The current Dice War state.

Returns

number[]

The seats that won a game that is over: the player who reached the score, or the most points when the rounds ran out, shared where level. Nobody while it goes on.

Examples

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

What it prints (run when this page was built)

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