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

checkNotationfunction

A spec from notation, or which part of the text was refused and why. Never a roll of something else.

Import it

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

Definition

function checkNotation(text: string, options?: NotationOptions): NotationCheck

Parameters

NameTypeDescription
textstring

Text to parse, validate or format.

options (optional)NotationOptions

Options for this call; omitted fields keep their documented defaults.

Returns

NotationCheck

A spec from notation, or which part of the text was refused and why. Never a roll of something else.

Examples

import { checkNotation } from "@johnmorrisdotca/korokoro";
console.log(checkNotation("not dice"));
{
  ok: false,
  problem: 'shape',
  part: 'not dice',
  message: '“not dice”: this is not dice notation'
}

What it prints (run when this page was built)

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