siteIcon

Tech Novice Tools

Processing Apps

burgerIcon

Game of Lifebacteria

Stage 2

Instructions

Conway's Game of Life is a simulation governed by 4 simple rules based on a cell's relationship to its 8 neighbors:

  • If a cell is alive, and 2 or 3 of its neighbours are also alive, the cell remains alive.
  • If a cell is alive and it has more than 3 alive neighbours, it dies of overcrowding.
  • If a cell is alive and it has fewer than 2 alive neighbours, it dies of loneliness.
  • If a cell is dead and it has exactly 3 neighbours it becomes alive again.

On a desktop, you can interact with the canvas environment in these ways:

  • Pause/Restart the simulation - Hit Spacebar (The canvas will turn pink when paused.)
  • Reload a random canvas of cells: Hit 'r' or 'R'
  • Clear the canvas: Hit 'c' or 'C'
  • If the simulation is paused, click on an empty cell to place a living cell; click on a living cell to kill it.

In addition to keyboard interaction, form buttons may be used to cause environmental changes as well.

We even added a population counter as well!

Note: Forms normally reload pages when buttons are pressed. We did not want that behavior, so we made the 'type' attribute 'button' for each of the controls. (Often it is valued as 'submit'). That change prevented the page from reloading when the buttons were pushed.

Last update: 10/31/19


Controls