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

serializeSetsfunction

Sets as text, to keep in storage. parseSets reads it back.

Import it

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

Definition

function serializeSets(sets: readonly DiceSet[]): string

Parameters

NameTypeDescription
setsreadonly DiceSet[]

The saved sets to read or update.

Returns

string

Sets as text, to keep in storage. parseSets reads it back.

Examples

import { serializeSets } from "@johnmorrisdotca/korokoro";
import { makeSet } from "@johnmorrisdotca/korokoro";
const set = makeSet("Longsword", "1d8+3")!;
console.log(serializeSets([set]));
{"version":1,"sets":[{"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.