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
| Name | Type | Description |
|---|---|---|
seed | number | 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.6697340414393693What it prints (run when this page was built)