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

randomAtfunction

A stream that starts draws numbers into seed's: randomAt(42, 7)() is the eighth number of mulberry32(42), reached without drawing the first seven. Use it to pick a stream up from a stored position.

Import it

import { randomAt } from "@johnmorrisdotca/tane";

Definition

function randomAt(seed: number, draws?: number): Random

Parameters

NameTypeDescription
seednumber

The numeric seed, read as an unsigned 32-bit integer by the stream.

draws (optional)number

The nonnegative number of draws already consumed.

Returns

Random

A stream that starts draws numbers into seed's: randomAt(42, 7)() is the eighth number of mulberry32(42), reached without drawing the first seven. Use it to pick a stream up from a stored position.

Examples

import { randomAt } from "@johnmorrisdotca/tane";

console.log(randomAt(42, 3)());
0.6697340414393693

What it prints (run when this page was built)

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