MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / nudge

Function nudge

test/life.c:41–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void nudge(void *u, int w, int h)
42{
43 unsigned (*univ)[w] = u;
44 int sum = 0;
45 for_xy sum += univ[y][x];
46 while (sum < (w*h)/8) {
47 int x = sum & (w-1);
48 int y = (sum*sum) & (h-1);
49 univ[y][x] = 1;
50 sum++;
51 }
52}
53
54void game(int w, int h, int i)
55{

Callers 1

gameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected