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

savedStreamfunction

A position as the object toJSON writes: the format, the seed, the draws and the state they come to.

Import it

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

Definition

function savedStream(position: StreamPosition): SavedStream

Parameters

NameTypeDescription
positionStreamPosition

The stream’s seed and nonnegative count of consumed draws.

Returns

SavedStream

A position as the object toJSON writes: the format, the seed, the draws and the state they come to.

Examples

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

const position = { seed: 42, draws: 3 };
console.log(savedStream(position));
{
  format: 1,
  generator: 'tane 1.3.0',
  algorithm: 'mulberry32',
  seed: 42,
  draws: 3,
  state: 1199730185
}

What it prints (run when this page was built)

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