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

RollSettype

The same roll thrown several times in one go, with what the set comes to.

Import it

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

Definition

type RollSet = {
    rolls: Roll[];
    sum: number;
    highest: number;
    lowest: number;
};

Members

NameTypeDescription
rollsRoll[]

Every roll, in the order thrown.

sumnumber

The totals added up.

highestnumber

The highest total.

lowestnumber

The lowest total.

Examples

import type { RollSet } from "@johnmorrisdotca/korokoro";
import { DEFAULT_SPEC, rollMany, seededSource } from "@johnmorrisdotca/korokoro";
const value: RollSet = rollMany(DEFAULT_SPEC, 3, seededSource("docs"), 0);
console.log(value.rolls.length);
3

What it prints (run when this page was built)

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