|
|
|
|
|
|
|
|
|
|
|
|
|
v |
For each cell, calculate how many live
neighbors it
|
|
has
out of its 8 neighbors.
|
|
|
v |
If
the cell is alive:
|
|
|
|
o |
If
it has 2 or 3 live neighbors, it remains alive.
|
|
|
|
o |
If
it has 0 or 1 live neighbors, it does of loneliness
|
|
|
|
o |
If
it has 4 or more live neighbors, it dies of overcrowding.
|
|
|
v |
If
the cell is dead:
|
|
|
|
o |
If
it has 3 live neighbors, it comes alive
|
|
|
|
o |
Otherwise
it remains dead.
|
|