Reference · Streams, draws and seeds
CountedRandomtype
A stream that knows where it is: call it for the next number, as any Random; read seed and draws, or take its position().
Import it
import type { CountedRandom } from "@johnmorrisdotca/tane";
Definition
type CountedRandom = Random & {
readonly seed: number;
readonly draws: number;
position(): StreamPosition;
};
Examples
import type { CountedRandom } from "@johnmorrisdotca/tane";
import { counted } from "@johnmorrisdotca/tane";
const position = { seed: 42, draws: 3 };
const value: CountedRandom = counted(42, 3);
console.log(value.position());{ seed: 42, draws: 3 }What it prints (run when this page was built)