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

rangeOffunction

The lowest and highest totals a spec can produce. An exploding die's highest is every explosion it is allowed.

Import it

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

Definition

function rangeOf(spec: RollSpec): { min: number; max: number; }

Parameters

NameTypeDescription
specRollSpec

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

Returns

{ min: number; max: number; }

The lowest and highest totals a spec can produce. An exploding die's highest is every explosion it is allowed.

Examples

import { rangeOf } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(rangeOf(spec));
{ min: 2, max: 12 }

What it prints (run when this page was built)

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