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

expectedHighestfunction

The average of the highest total among several throws of a roll. Exact: the highest is at most t when every throw is.

Import it

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

Definition

function expectedHighest(spec: Odds, times: number): number

Parameters

NameTypeDescription
specOdds

Dice counts, sides, rules and modifier; omitted fields use the documented defaults.

timesnumber

The number of independent repeats.

Returns

number

The average of the highest total among several throws of a roll. Exact: the highest is at most t when every throw is.

Examples

import { expectedHighest } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(expectedHighest(spec, 3));
9.057870370370377

What it prints (run when this page was built)

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