Skip to content

Random

Info

Dependencies:
- None
Implementation:
Random.d on GitHub

Provides more random randomization than Hlp_Random() function.

Initialization

Initialize with LeGo_Random flag.

LeGo_Init(LeGo_Random);

Functions

r_Next

r_Next

Returns a random number.

func int r_Next()
Return value

The function returns a random number.

r_Max

r_Max

Returns a random number from 0 to max.

func int r_Max(var int max)
Parameters
  • var int max
    Maximum value of number

Return value

The function returns a random number from 0 to 'max'.

r_MinMax

r_MinMax

Returns a random number from 'min' to 'max'.

func int r_MinMax(var int min, var int max)
Parameters
  • var int max
    Maximum value of number
  • var int min
    Minimum value of number

Return value

The function returns a random number from min to max.

r_Init

r_Init

Initializes the random number generator. Happens optionally in LeGo_Init.

func void r_Init(var int seed)
Parameters
  • var int seed
    The initializing value

r_DefaultInit

r_DefaultInit

Initializes the random number generator based on the current time.

func void r_DefaultInit()