MCPcopy Create free account
hub / github.com/NetHack/NetHack / srandom

Function srandom

sys/share/random.c:203–222  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

201 */
202
203void
204srandom(x)
205
206unsigned x;
207{
208 register int i;
209
210 if (rand_type == TYPE_0) {
211 state[0] = x;
212 } else {
213 state[0] = x;
214 for (i = 1; i < rand_deg; i++) {
215 state[i] = 1103515245 * state[i - 1] + 12345;
216 }
217 fptr = &state[rand_sep];
218 rptr = &state[0];
219 for (i = 0; i < 10 * rand_deg; i++)
220 random();
221 }
222}
223
224/*
225 * initstate:

Callers 2

random.cFile · 0.85
rnd.cFile · 0.85

Calls 1

randomFunction · 0.85

Tested by

no test coverage detected