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

diceWarOddsfunction

The exact odds of one throw of Dice War among players players, from the package's own odds for the dice: the chance the throw is settled at once and the chance of war, and, for a total you name, how it fares against everybody else's. Worked out from the totals' exact odds, never simulated.

Import it

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

Definition

function diceWarOdds(options: { players: number; dice?: number; sides?: number; }, total?: number): DiceWarChances

Parameters

NameTypeDescription
options{ players: number; dice?: number; sides?: number; }

Options for this call; omitted fields keep their documented defaults.

total (optional)number | undefined

The total to measure or compare.

Returns

DiceWarChances

The exact odds of one throw of Dice War among players players, from the package's own odds for the dice: the chance the throw is settled at once and the chance of war, and, for a total you name, how it fares against everybody else's. Worked out from the totals' exact odds, never simulated.

Examples

import { diceWarOdds } from "@johnmorrisdotca/korokoro";
console.log(diceWarOdds({ players: 2, dice: 1, sides: 6 }).war);
0.16666666666666674

What it prints (run when this page was built)

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