MCPcopy Create free account
hub / github.com/DFHack/dfhack / df_trandom

Method df_trandom

library/modules/Random.cpp:108–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108int32_t MersenneRNG::df_trandom(uint32_t max)
109{
110 if(max<=1)return 0;
111 uint32_t seed=random();
112 seed=seed%2147483647LU;
113 seed=seed/((2147483647LU/max)+1);
114
115 return((int32_t)seed);
116}
117
118int32_t MersenneRNG::df_loadtrandom(uint32_t max)
119{

Callers 5

chooseWordFunction · 0.45
generateNameMethod · 0.45
ripeFunction · 0.45
getMoodSkillFunction · 0.45
df_strangemoodFunction · 0.45

Calls 1

randomFunction · 0.85

Tested by

no test coverage detected