Reference · Framing, geometry and quiz tools
Randomtype
A number in [0, 1), like Math.random, from a stream a seed fixes.
Import it
import type { Random } from "@johnmorrisdotca/chizu";
Definition
type Random = () => number;
Examples
import { shuffled, type Random } from "@johnmorrisdotca/chizu";
const alwaysFirst: Random = () => 0;
console.log(shuffled(["a", "b", "c"], alwaysFirst).length);
// 33What it prints (run when this page was built)