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(seed) Constructor.
- ::next(n) Returns a random integer between 0 and (n - 1).
- ::nextBetween(min, max) Returns a random integer between min and max.
- ::nextBool() Returns a random bool.
- ::nextDirection() Returns a random direction, -1 or 1.
- ::nextFloat() Returns a random float between 0 and 1.
Constructor Details
::constructor(seed) Source
Public: Constructor.
seed - initial seed (default: random)
Instance Method Details
::next(n) Source
Public: Returns a random integer between 0 and (n - 1).
n - integer
::nextBetween(min, max) Source
Public: Returns a random integer between min and max.
min - integer
max - integer
::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.