Conway's Game of Life

The rules for each successive generation of Conway's
Game of Life is to count the number of neighbouring
cells to determine what the new state of a cell is.

The new state is:
  1. empty; if there are less than two neighbours or more than three neighbours
  2. occupied; if there are three neighbours
  3. unchanged from the previous generation; if there are two neighbours