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

seededSourcefunction

sfc32 started from a text seed: the same seed gives the same rolls on every platform, forever. Not for anything that must be unguessable.

Import it

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

Definition

function seededSource(seed: string): RandomSource

Parameters

NameTypeDescription
seedstring

Text that reproduces the same random sequence, or null for an unseeded stored roll.

Returns

RandomSource

sfc32 started from a text seed: the same seed gives the same rolls on every platform, forever. Not for anything that must be unguessable.

Examples

import { seededSource } from "@johnmorrisdotca/korokoro";
console.log(seededSource("table").next() === seededSource("table").next());
true

What it prints (run when this page was built)

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