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

stateAtfunction

The generator's state after draws numbers have been taken from seed: an unsigned 32-bit integer. It is what step hands back as state after that many steps, worked out in one go. mulberry32(stateAt(seed, n)) carries on from the n-th draw.

Import it

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

Definition

function stateAt(seed: number, draws?: number): number

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

number

The generator's state after draws numbers have been taken from seed: an unsigned 32-bit integer. It is what step hands back as state after that many steps, worked out in one go. mulberry32(stateAt(seed, n)) carries on from the n-th draw.

Examples

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

console.log(stateAt(42, 3));
1199730185

What it prints (run when this page was built)

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