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

parseSetsfunction

Sets read back from their text. Anything that is not a sound set is dropped; text that is not a list reads as none.

Import it

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

Definition

function parseSets(text: string | null): DiceSet[]

Parameters

NameTypeDescription
textstring | null

Text to parse, validate or format.

Returns

DiceSet[]

Sets read back from their text. Anything that is not a sound set is dropped; text that is not a list reads as none.

Examples

import { parseSets } from "@johnmorrisdotca/korokoro";
import { makeSet, serializeSets } from "@johnmorrisdotca/korokoro";
const set = makeSet("Longsword", "1d8+3")!;
console.log(parseSets(serializeSets([set])).length);
1

What it prints (run when this page was built)

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