Options
All
  • Public
  • Public/Protected
  • All
Menu

Random value generator with a seed.

const rand1 = new Random();
const rand2 = new Random(12345); // with seed

console.log(rand1.next());
console.log(rand1.nextInt(1, 10));

Hierarchy

  • Random

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Random(seed?: number): Random

Properties

Private _w

_w: number

Private _x

_x: number

Private _y

_y: number

Private _z

_z: number

Methods

next

  • next(): number

nextInt

  • nextInt(min: number, max: number): number
  • Returns next random value with the bound from min to max, which includes min and max.

    Parameters

    • min: number
    • max: number

    Returns number

Generated using TypeDoc