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

makeSetfunction

A set from a name and a roll, or null when the name is empty or too long or the dice cannot be rolled. The name is trimmed.

Import it

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

Definition

function makeSet(name: string, dice: RollSpec | string): DiceSet | null

Parameters

NameTypeDescription
namestring

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

dicestring | RollSpec

Dice notation, or a callback giving notation for a formula group.

Returns

DiceSet | null

A set from a name and a roll, or null when the name is empty or too long or the dice cannot be rolled. The name is trimmed.

Examples

import { makeSet } from "@johnmorrisdotca/korokoro";
console.log(makeSet("Longsword", "1d8+3"));
{ name: 'Longsword', notation: '1d8+3' }

What it prints (run when this page was built)

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