Right now it simply flips bits instead of checking neighbors
local running = false
+function generation(cells)
+ local tab = {}
+ for i,row in ipairs(cells) do
+ tab[i] = {}
+ for j,cell in ipairs(row) do
+ tab[i][j] = { cell = cell.cell, live = not cell.live }
+ end
+ end
+ return tab
+end
+
function draw(cells)
for i,row in ipairs(cells) do
for j,r in ipairs(row) do
else
-- running
draw(cells)
+ cells = generation(cells)
end
end