IosephKnecht / CellsParadise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CellsParadise

Task from the book "Etudes for Programmers". Implement the 'Game of Life with the following rules:

  • The immediate neighbors of a cell are those cells occupying the eight horizontally, vertically, and diagonally adjacent cells.

  • If a LIFE cell has fewer than two immediate neighbors, it dies of loneliness. If a LIFE cell has more than three immediate neighbors, it dies of overcrowding.

  • If an empty square has exactly three LIFE cells as immediate neighbors, a new cell is born in the square.

  • Births and deaths all take place exactly at the change of generations. Thus a dying cell may help birth a new one, but a newborn cell may not resurrect a dying cell, nor may one dying cell stave off death for another by lowering the local population density.

About


Languages

Language:C# 100.0%