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

chanceAnyAtLeastfunction

The chance that at least one of several throws of a roll reaches a target: a set of six ability scores holding at least one 16, say.

Import it

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

Definition

function chanceAnyAtLeast(spec: Odds, target: number, times: number): number

Parameters

NameTypeDescription
specOdds

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

targetnumber

The DOM host, or the target total for a probability calculation.

timesnumber

The number of independent repeats.

Returns

number

The chance that at least one of several throws of a roll reaches a target: a set of six ability scores holding at least one 16, say.

Examples

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

What it prints (run when this page was built)

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