Conway's Game of Life is a relatively straight forward cellular automata. I created an interactive demo using the rules that exists for it, using Go and Raylib.

Full source code is found on github, here BrianDouglasIE/conways-game-of-life.

Wikipedia tells me that these are the rules by which a cell can be determined to be alive or dead.

  • Any live cell with fewer than two live neighbours dies, as if by underpopulation.
  • Any live cell with two or three live neighbours lives on to the next generation.
  • Any live cell with more than three live neighbours dies, as if by overpopulation.
  • Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

With this in mind I was able to create the below demo. I added interactivity by allowing the user to click a cell to toggle it's state between dead and alive. Pressing the up arrow key runs the next cycle.