nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
Utils::Random Namespace Reference

Better random number generator. More...

Functions

void seed ()
 Must be called before any of those.
 
int between (int min, int max)
 Random number between min and max.
 
bool boolean ()
 Random boolean.
 
bool booleanWithChance (float percent)
 Random boolean with chance of #percent.
 

Detailed Description

Better random number generator.

Function Documentation

◆ between()

int Utils::Random::between ( int min,
int max )

Random number between min and max.

Definition at line 48 of file Utils.cpp.

◆ boolean()

bool Utils::Random::boolean ( )

Random boolean.

Definition at line 56 of file Utils.cpp.

◆ booleanWithChance()

bool Utils::Random::booleanWithChance ( float percent)

Random boolean with chance of #percent.

Note
Precision up to 2 decimal digits.

Definition at line 64 of file Utils.cpp.

◆ seed()

void Utils::Random::seed ( )

Must be called before any of those.

Definition at line 41 of file Utils.cpp.