Skip to content

Random

Provides more random randomization than Hlp_Random() function.

Dependencies

N/A

Initialization

Initialize with LeGo_Random flag.

LeGo_Init(LeGo_Random);

Implementation

Random.d on GitHub

Functions

r_Next

Returns a random number.

func int r_Next()
Return value

The function returns a random number.

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

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

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

Initializes the random number generator based on the current time.

func void r_DefaultInit()