ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
|
Namespaces | |
namespace | anonymous_namespace{random.cpp} |
Functions | |
int | random (int max) |
Generate a random integer between 0 and max. | |
int | between (int min, int max) |
Generate a random integer between min and max. | |
float | random (float max) |
Generate a random float between 0 and max. | |
float | between (float min, float max) |
Generate a random float between min and max. | |
bool | chance () |
Generate a random boolean. | |
bool | chance (float chance) |
Generate a random boolean with a given chance of being true. | |
float asw::random::between | ( | float | min, |
float | max ) |
Generate a random float between min and max.
min | The minimum value. |
max | The maximum value. |
Definition at line 27 of file random.cpp.
int asw::random::between | ( | int | min, |
int | max ) |
Generate a random integer between min and max.
min | The minimum value. |
max | The maximum value. |
Definition at line 17 of file random.cpp.
bool asw::random::chance | ( | ) |
Generate a random boolean.
Definition at line 32 of file random.cpp.
bool asw::random::chance | ( | float | chance | ) |
Generate a random boolean with a given chance of being true.
chance | The chance of being true between 0 and 1. |
Definition at line 37 of file random.cpp.
float asw::random::random | ( | float | max | ) |
Generate a random float between 0 and max.
max | The maximum value. |
Definition at line 22 of file random.cpp.
int asw::random::random | ( | int | max | ) |
Generate a random integer between 0 and max.
max | The maximum value. |
Definition at line 12 of file random.cpp.