This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Conway's Game of Life

by subpixel

Based on Conway.pde by Mike Davis

At each iteration, the following transitions occur:

  1. Any live cell with fewer than two live neighbours dies, as if by needs caused by underpopulation.
  2. Any live cell with more than three live neighbours dies, as if by overcrowding.
  3. Any live cell with two or three live neighbours lives, unchanged, to the next generation.
  4. Any tile with exactly three live neighbours cells will be populated with a living cell.



Optimisations made reduce the time taken to render each frame by around 50% or more compared to the original on my machine (2GHz Pentium-M based laptop). eg, for a 1300x1000 world, the original code (with a few lines added for the time calculation, and the size() and frameRate() call parameters increased) renders each iteration in around 170ms; the optimised program takes only around 80ms (when there are relatively fewer births and deaths; when there are a lot of births and deaths the time can get much higher, but this usually only lasts a few iterations until the number of births and deaths lowers again.

See the program source for details.

Source code: Conway_mod_by_spxl

Built with Processing