The Way of Life

Click or touch the screen to add new cells.

The Conway's game of life features an infinite grid of square cells which can be alive or dead. Each cell interacts with its eight neighbours following two rules:

  1. An empty cell that has exactly 3 neighbors is "born" into in the next generation.
  2. An occupied cell that has exactly 2 or 3 neighbors survives to the next generation. Otherwise, its occupant dies (of loneliness or overcrowding).

There is a one line implementation of this game in APL:

life←{ ↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ }

What you are seeing is a more naïve javascript implementation of conway's game of life using an HTML canvas to draw it.

This implementation features a universe that is a torus, ie. screen borders are connected and a cell that goes through the right border will reappear on the left one.


Made with ☮ by Maxime R.
Star