One-row in-place Life update (source code)

= One-row in-place Life update

On a finite rectangular <Conway's Game of Life> board stored as an <array> of <Boolean variables>, retain the preceding row's old values in one auxiliary row. Before overwriting a column, retain rolling sums of the old three-cell vertical columns. Their sum minus the old center is the old neighbor count. Read the next column before changing the current one; replace the saved row entry by the old current cell. The invariant is that every count uses the previous generation, just as in the two-<array> <algorithm>. For a board with $H$ rows and $W$ columns this uses $O(W)$ auxiliary storage and $O(HW)$ time. The boundary convention must still be implemented explicitly. The <Life blinker> and <Life glider> provide exact expected generations for checking it.