MCPcopy Create free account
hub / github.com/assaultcube/AC / lsrand

Function lsrand

source/src/bot/bot_util.cpp:65–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void lsrand (unsigned long initial_seed)
66{
67 // this function initializes the random seed based on the initial seed value
68 // passed in the initial_seed parameter. Since random seeds are
69 // usually initialized with the time of day, and time is a value that
70 // changes slowly, we bump the seed twice to have it in a more
71 // random state for future calls of the random number generator.
72
73 // fill in the initial seed of the random number generator
74 lseed = (long) initial_seed;
75 lseed = lrand (); // bump it once
76 lseed = lrand (); // bump it twice
77 return; // that's all folks
78}
79
80long RandomLong (long from, long to)
81{

Callers 1

InitMethod · 0.85

Calls 1

lrandFunction · 0.85

Tested by

no test coverage detected