Hello. Welcome to my site. You can find more about me on the >About page, read something on the >blog or -> explore some of my >projects (or use the buttons below).

To go back to the previous page, all you need to do is click the heading at the top (Chcknlegwill in this case) and you'll be sent to the previous page. Or you can use the newly added navigation bar just below the header to go to different pages.

Random article from >blog or >projects below:


Title: Conway's game of life.

Published:

p5.js

I would like to start this post by giving thanks to the p5.js library for making this possible as well as the p5-svelte API for making p5.js work with svelte to be very simple with the least hastle I’ve has with any other 3d / graphics in Javascript.

What is Conways game of life?

Conways game of life or just ‘life’ is a cellular automaton that is a zero player game / simulation. The simulation consists of a grid containing “cells” - these cells can be in one of two states: ‘alive’ or ‘dead’, these cells are then subjected to 3 rules that define the whole game:

  • Any 'alive' cell with less than two neighbours dies.
  • Any 'alive' cell with two or three neighbours lives on to the next generation.
  • Any 'alive' cell with more than three live neighbours dies.
  • Any 'dead' cell with exactly three live neighbours becomes an 'alive' cell.

Simulaton of Conway’s game of life

Below should be a simulation of Conway’s game of life:

(clicking anywhere resets the canvas)