In the above example, a cell that has 2 living cells surrounding it will survive. If 3 living cells surround surround the cell, it can come back from the dead. This function is called every step of the simulation and is passed an array of neighbors to this cell. […]

Link