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

getPresetfunction

A preset by its id, its name or any of its other names: getPreset("yahtzee") and getPreset("Yacht") are the same game. Undefined when there is none.

Import it

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

Definition

function getPreset(name: string): Preset | undefined

Parameters

NameTypeDescription
namestring

The preset or saved-set name to look up or write.

Returns

Preset | undefined

A preset by its id, its name or any of its other names: getPreset("yahtzee") and getPreset("Yacht") are the same game. undefined when there is none.

Examples

import { getPreset } from "@johnmorrisdotca/korokoro";
console.log(getPreset("Yacht")?.id, getPreset("unknown"));
yahtzee undefined

What it prints (run when this page was built)

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