API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classRandom

@codexo/exojs / math / stable

Seedable pseudo-random number generator based on the Mersenne Twister (MT19937) algorithm. Produces 32-bit unsigned integers with period 2^19937−1, normalised to the `[min, max)` range requested by each next call. The generator is deterministic: calling `setSeed(s)` followed by the same sequence of `next()` calls always produces the same output. Use `reset()` to replay from the current seed without changing it.

3
props
4
methods
0
events
Import
import { Random } from '@codexo/exojs'

Seedable pseudo-random number generator based on the Mersenne Twister (MT19937) algorithm. Produces 32-bit unsigned integers with period 2^19937−1, normalised to the `[min, max)` range requested by each next call.

The generator is deterministic: calling `setSeed(s)` followed by the same sequence of `next()` calls always produces the same output. Use `reset()` to replay from the current seed without changing it.

Constructors 1
new(seed: number): Random
Methods 4
destroy(): void
next(min: number, max: number): number
reset(): this
setSeed(seed: number): this
Properties 3
iteration: number
seed: number
value: number
Source