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

Function init_isaac64

src/rnd.c:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void
43init_isaac64(unsigned long seed, int (*fn)(int))
44{
45 unsigned char new_rng_state[sizeof seed];
46 unsigned i;
47 int rngindx = whichrng(fn);
48
49 if (rngindx < 0)
50 panic("Bad rng function passed to init_isaac64().");
51
52 for (i = 0; i < sizeof seed; i++) {
53 new_rng_state[i] = (unsigned char) (seed & 0xFF);
54 seed >>= 8;
55 }
56 isaac64_init(&rnglist[rngindx].rng_state, new_rng_state,
57 (int) sizeof seed);
58}
59
60staticfn int
61RND(int x)

Callers 1

set_randomFunction · 0.85

Calls 3

whichrngFunction · 0.85
isaac64_initFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected