EVO PRODUCTIONS

Conway's Game of Life

Playing around with JS

One day I got obsessed with videos about Conway's Game of Life. So obsessed in fact that I decided I wanted it on my website. This meant I had to make it using JavaScript so I could easily display it on my website. This was my first time using an html canvas in combination with JavaScript. JavaScript itself is also very new to me still since I barely use it. That's why this project was a great exercise to learn.

Explanation

The game of life is a cellular automation created by John Conway. It is a simulation in which only the initial state can be changed. The rest of the simulation tries to mimic a form of life by following four simple 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.

Controls

You can play my version of the Game of Life to the right of this text.

The randomise button will fill the canvas with random spots to simulate, but if you want more control, you can place squares yourself by clicking on the canvas.

When you're ready to play the simulation, you can press the Play/Stop button.

If you want to see what's happening more clearly you can also single step through the simulation using the next button.

Afterwards you can clear the screen with the clear button.

Play/Stop

Next

Randomise

Clear