MCPcopy Create free account
hub / github.com/SimHacker/micropolis / getERandom

Method getERandom

MicropolisCore/src/MicropolisEngine/src/random.cpp:145–151  ·  view source on GitHub ↗

* Get a random number within a given range, with a preference to smaller * values. * @param limit Upper bound of the range (inclusive). * @return Random number between \c 0 and \a limit (inclusive). */

Source from the content-addressed store, hash-verified

143 * @return Random number between \c 0 and \a limit (inclusive).
144 */
145short Micropolis::getERandom(short limit)
146{
147 short z = getRandom(limit);
148 short x = getRandom(limit);
149
150 return min(z, x);
151}
152
153
154/** Initialize the random number generator with a 'random' seed. */

Callers

nothing calls this directly

Calls 1

minFunction · 0.85

Tested by

no test coverage detected