eolib 0.5.0
A core C library for writing applications related to Endless Online
Loading...
Searching...
No Matches
rng.h File Reference
#include <stdint.h>

Go to the source code of this file.

Functions

void eo_srand (uint32_t seed)
uint32_t eo_rand ()
uint32_t eo_rand_range (uint32_t min, uint32_t max)

Function Documentation

◆ eo_rand()

uint32_t eo_rand ( )

Generate a pseudo-random 32-bit unsigned integer. The sequence of numbers generated depends on the seed set by eo_srand().

Remarks
Emulates the behavior of the original game client.

Definition at line 12 of file rng.c.

◆ eo_rand_range()

uint32_t eo_rand_range ( uint32_t min,
uint32_t max )

Generate a pseudo-random 32-bit unsigned integer within a specified range [min, max]. The sequence of numbers generated depends on the seed set by eo_srand().

Definition at line 38 of file rng.c.

◆ eo_srand()

void eo_srand ( uint32_t seed)

Seed the random number generator with a 32-bit unsigned integer. The same seed will produce the same sequence of random numbers. The seed is transformed internally to initialize the generator's state.

Definition at line 6 of file rng.c.