Spectacular Cellular Automata
    Preparing search index...

    Function dayAndNightRule

    • Day & Night Rule

      • Birth: Dead cell (0) with 3, 6, 7, or 8 neighbours becomes alive (1).
      • Survival: Alive cell (1) with 3, 4, 6, 7, or 8 neighbours remains alive.

      Parameters

      • cellState: 0 | 1

        The current state of the cell (0 = DEAD, 1 = ALIVE)

      • aliveNeighbours: number

        The number of alive neighbours

      Returns 0 | 1

      • The new cell stata