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

readSetfunction

A set from a link's query, or null when it holds none or its dice cannot be rolled. A link with dice and no name is a set called by its notation.

Import it

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

Definition

function readSet(query: string | URLSearchParams): DiceSet | null

Parameters

NameTypeDescription
querystring | URLSearchParams

A query string or URLSearchParams containing the shared settings.

Returns

DiceSet | null

A set from a link's query, or null when it holds none or its dice cannot be rolled. A link with dice and no name is a set called by its notation.

Examples

import { readSet } from "@johnmorrisdotca/korokoro";
import { makeSet, setQuery } from "@johnmorrisdotca/korokoro";
const set = makeSet("Longsword", "1d8+3")!;
console.log(readSet(setQuery(set))?.name);
Longsword

What it prints (run when this page was built)

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