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

withSetfunction

The sets with one added, newest first. A set of the same name is replaced, and the oldest go past MAX_SETS. Returns a new list.

Import it

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

Definition

function withSet(sets: readonly DiceSet[], set: DiceSet): DiceSet[]

Parameters

NameTypeDescription
setsreadonly DiceSet[]

The saved sets to read or update.

setDiceSet

The saved set to add or share.

Returns

DiceSet[]

The sets with one added, newest first. A set of the same name is replaced, and the oldest go past MAX_SETS. Returns a new list.

Examples

import { withSet } from "@johnmorrisdotca/korokoro";
import { makeSet } from "@johnmorrisdotca/korokoro";
const set = makeSet("Longsword", "1d8+3")!;
console.log(withSet([], set).map((saved) => saved.name));
[ 'Longsword' ]

What it prints (run when this page was built)

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