Reference · Game engine and table
Randomtype
A source of numbers in [0, 1): Math.random, or a seeded one so a deal can be made again.
Import it
import type { Random } from "@johnmorrisdotca/hitotsu";
Definition
type Random = () => number;
Examples
import type { Random } from "@johnmorrisdotca/hitotsu";
import { seededRandom } from "@johnmorrisdotca/hitotsu";
const value: Random = seededRandom(42);
console.log(value());0.6011037519201636What it prints (run when this page was built)