Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Functions
rng.cpp File Reference
#include "shared/utilities/rng.hpp"
#include <random>
#include <utility>

Functions

double randomDouble (double min, double max)
 
int randomInt (int min, int max)
 

Function Documentation

◆ randomDouble()

double randomDouble ( double  min,
double  max 
)

Generate a random double between given min and max values.

See also
https://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution
Parameters
mininclusive lower end of range for random number
minexclusive upper end of range for random number
Returns
random double within the specified range

◆ randomInt()

int randomInt ( int  min,
int  max 
)

Generate a random integer between given min and max values.

See also
https://en.cppreference.com/w/cpp/numeric/random/uniform_int_distribution
Parameters
mininclusive lower end of range for random number
mininclusive upper end of range for random number
Returns
random integer within the specified range