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

ExactCountstype

The odds as whole numbers: how many of the equally likely outcomes make each total.

Import it

import type { ExactCounts } from "@johnmorrisdotca/korokoro";

Definition

type ExactCounts = {
    min: number;
    counts: bigint[];
    outcomes: bigint;
};

Members

NameTypeDescription
minnumber

The lowest total the dice can make.

countsbigint[]

counts[i] is the number of outcomes that total min + i.

outcomesbigint

How many outcomes there are: the sides to the power of the dice.

Examples

import type { ExactCounts } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, exactCounts } from "@johnmorrisdotca/korokoro";
const value: ExactCounts = exactCounts(DEFAULT_SPEC)!;
console.log(String(value.outcomes));
36

What it prints (run when this page was built)

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