MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / setseed

Function setseed

extlibs/lua/src/lmathlib.c:591–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589
590
591static void setseed (lua_State *L, Rand64 *state,
592 lua_Unsigned n1, lua_Unsigned n2) {
593 int i;
594 state[0] = Int2I(n1);
595 state[1] = Int2I(0xff); /* avoid a zero state */
596 state[2] = Int2I(n2);
597 state[3] = Int2I(0);
598 for (i = 0; i < 16; i++)
599 nextrand(state); /* discard initial values to "spread" seed */
600 lua_pushinteger(L, n1);
601 lua_pushinteger(L, n2);
602}
603
604
605/*

Callers 2

randseedFunction · 0.85
math_randomseedFunction · 0.85

Calls 3

Int2IFunction · 0.85
nextrandFunction · 0.85
lua_pushintegerFunction · 0.85

Tested by

no test coverage detected