Skip to the content

Tane種

Reproduce numbers from a seed, shuffle or pick items, share a daily puzzle and resume a saved stream.

Tane means seed in Japanese. About the name

Contents

Reference · Streams, draws and seeds

Randomtype

A number in [0, 1), like Math.random, from a stream a seed fixes.

Import it

import type { Random } from "@johnmorrisdotca/tane";

Definition

type Random = () => number;

Examples

import type { Random } from "@johnmorrisdotca/tane";
import { mulberry32 } from "@johnmorrisdotca/tane";

const value: Random = mulberry32(42);
console.log(value());
0.6011037519201636

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tane 1.3.0.