Task 5 of 5
B3/S23 is one point in a whole family. Any outer-totalistic rule is fully
described by two 9-entry tables: born[n] — does a dead cell with n live
neighbors come alive? — and stay[n] — does a live cell with n survive? Conway
is born[3] = 1, stay[2] = stay[3] = 1, zeros everywhere else.
HighLife adds born[6] = 1 and suddenly the world contains a
pattern that builds copies of itself.
Here's the move that matters: pass the tables as kernel arguments.
The rulebook stops being code and becomes data — one compiled kernel runs every universe
in the family, and switching physics is just passing different arrays. No if
per rule, no recompile: alive cells look up stay[count], dead cells look up
born[count].
evolve kernel so it applies whatever
rule tables it's handed — then let the wired-up code count where Life and HighLife disagree
about the same world's next tick.world, born and stay — don't hard-code any ruleself === 0) return born[count]self === 1) return stay[count]count is a number from 0 to 8, and born is a 9-entry
array — born[count] is already the answer for a dead cell. The lookup
is the rule.
let fate = born[count];
if (self === 1) fate = stay[count];
return fate;__constant__
memory, WebGPU and Metal bind them as uniform buffers — same shader, new physics, zero
pipeline rebuilds.
This page is an interactive exercise — the editor, the GPU runner and your saved progress need JavaScript. The text above is the full brief.