Created with p5.js and JavaScript/HTML/CSS. By Magno El Magnifico
John Horton Conway was an English mathematician who contributed in several math theories: such us number theory or coding theory.
He also created the math branch of cellular automata with his Game of Life.
Note: He hated this game because it overshadowed the rest of his career where he worked deeper.
This consists in a finite or infinite grid, and each cell have
several states; in this case on/off, life/dead, 0/1 or
true/false.
Each cell's state depends on its neighbors (cells around it) by the game rules which changes the game each generation (game update):
-
Birth rule: A "dead", cell with precisely three "live" neighbors becomes live.
-
Death rule: A "live" cell with 0 or 1 neighbors dies of isolation; a "live" cell with 4 or more neighbors dies of overcrowding.
-
Survival rule: A "live" cell with 2 or 3 neighbors remains alive.
There are some different types of patterns that we can create:
-
Still lives: Forever alive and static.
-
Oscilators: The pattern itself has several states that repeats after some generations (period).
-
Spaceships: Patterns that are constantly moving across the grid.
-
Methuselah: Patterns that take lots of generations to stabilize (end up with only still lives, oscilators and spaceships) or die.
-
Infinite growth: Patterns that are always expanding, such us guns (creates spaceships).
This pattern (called block) is the simplest still lives. The survival rule keeps it alive forever.
This blinker is the smallest oscilator with a period of 2. Here all the rules are involved (birth rule creates new cells on the side, death rule kills the others on the side and survival rule keeps alive the center cell).
This is a glider, the simplest spaceship. It travels at c speed (light speed), the maximum allowed by this "Universe" (the birth rule only allows cells to be created side by side, so you cannot travel faster than 1 cell per generation).
This pattern is called diehard. It takes 130 generations to die (Mathuselah).
This pattern (called gosped glider gun) creates a glider every 30 generations, so, in a infinite grid, it is growing forever.
Combining some of these patterns and others, you can create interesting things:
-
If gliders collide with a block in a specific position, the block will move. This can be used to make a counter.
-
It is also posible create
and,orandnotgates. -
Combining these (counter and the gates) you can create a Turing Machine.
-
And more!
No setup needed. Just open the index.html file on your browser, or
game.html which only contains the game.
You can configurate the game in several ways by changing the
variable value in the code (game.js) or using the JavaScript console:
- Size:
w, line2(Default: 600). - Number of cells per row/column:
ncells, line3(Default: 20). - Update time:
update_time(milliseconds), line6(Default: 100). - Render grid:
render_grid(true/false), line7(Default:true). - Neighbors counting style: change how the neighbors are counted
(more info here).
moore(truefor Moore neighbors andfalsefor von Neumann neighbors), line8(Default:true).






