Map cell (row, column) to bit row*16+column. Count its eight in-bounds neighbors. A live cell survives with two or three neighbors; a dead cell becomes live with exactly three. Treat locations outside the grid as dead.
Map cell (row, column) to bit row*16+column. Count its eight in-bounds neighbors. A live cell survives with two or three neighbors; a dead cell becomes live with exactly three. Treat locations outside the grid as dead.