Clear all cells.
export function clearGrid() { let clearedCells = new Set(); sharedState.cells.forEach((cell, i) => { if (cell !== 0) { // Dying cells would be undone as alive cells sharedState.cells[i] = 0; clearedCells.add(i); } }); pushHistory(Change(clearedCells, 0, "Clear"));} Copy
export function clearGrid() { let clearedCells = new Set(); sharedState.cells.forEach((cell, i) => { if (cell !== 0) { // Dying cells would be undone as alive cells sharedState.cells[i] = 0; clearedCells.add(i); } }); pushHistory(Change(clearedCells, 0, "Clear"));}
Clear all cells.