Game of life

Per wikipedia:
Game of life is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.

Rules:

  1. Any live cell with fewer than two live neighbours dies, as if by underpopulation.
  2. Any live cell with two or three live neighbours lives on to the next generation.
  3. Any live cell with more than three live neighbours dies, as if by overpopulation.
  4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
In original Conway's game of life the "playing field" should be infinite. It is not a case here, because the target of this project was to use native JavaScript only.

You can click on each square to toggle its status. After generating a new board, an inital life will be there to showcase the game's logic. If you generate a 50x50 board (inital on page load), the sample life generated will be a bit more complex.