Conways Game - Of Life Unblocked Work [exclusive]

generation = 0; updateUI(); draw();

Here are some common questions and answers about playing Conway's Game of Life at work: conways game of life unblocked work

function drawGrid() ctx.clearRect(0,0,canvas.width,canvas.height); for(let y=0;y<rows;y++) for(let x=0;x<cols;x++) if (grid[y][x]) ctx.fillStyle = '#222'; ctx.fillRect(x*cellSize, y*cellSize, cellSize, cellSize); else ctx.fillStyle = '#fff'; ctx.fillRect(x*cellSize, y*cellSize, cellSize, cellSize); ctx.strokeStyle = '#eee'; ctx.strokeRect(x*cellSize, y*cellSize, cellSize, cellSize); generation = 0; updateUI(); draw(); Here are some

return sum;

grid = next; draw();