Class Fz2D.Random

Defined in: src/sys/random.coffee

Overview

Public: Random

Constant Summary

UINT_MAX =
Private: Maximum Unsigned Integer.
0xffffffff
BITS =
Private: Number of bits.
32

Instance Method Summary

Constructor Details

::constructor(seed) Source

Public: Constructor. seed - initial seed (default: random)

Parameters:

  • seedinitial seed (default: random)

Instance Method Details

::next(n) Source

Public: Returns a random integer between 0 and (n - 1). n - integer

Parameters:

  • ninteger

::nextBetween(min, max) Source

Public: Returns a random integer between min and max. min - integer max - integer

Parameters:

  • mininteger
  • maxinteger

::nextBool() Source

Public: Returns a random bool.

::nextDirection() Source

Public: Returns a random direction, -1 or 1.

::nextFloat() Source

Public: Returns a random float between 0 and 1.