Cellular Automaton - Conway's Game of Life.This program is capable of simulating many different cellular automaton including, The Game of Life using the HTML 5 Canvas element and javascript.Just draw various shapes using the mouse and click 'Done' to see them evolve. Full instructions are at the bottom.
Done
Grid
Zoom
Reset
Color
Mode
Enter the Custom Rule
Enter the Custom 1-D Rule
Number of Cycles
What is Conway's Game of Life?
Conway's Game of Life is a cellular automaton in which simple starting conditions can lead to complicated results. Not really a game, in you only enter the starting conditions, but fun to play nonetheless. The game is remarkable simple in how it works. Each cells lives( is on ) or dies( is off ) depending only on how many neighbor cells are alive. For Conway's Game of Life the rules are as follows:
Simple Rules of Conway's Game of Life:
These simple rules are what lead to the amazing complexity you see in the game. Learn More About Conway's Game of Life Instructions
The game starts in setup mode. You can change all the settings of the game in this mode and change any cells.
Click or Drag the Mouse to set cells as alive or dead. The game screen starts with all dead cells. When finished setting some living cells, click "Done" to run the game.
'Size' When in setup mode you can change the total number of cells to 4 possible sizes, by clicking the 'Size' button. The minimum size is 32 by 32 cells, the maximum is 256 x 256 cells. Once you start clicking cells, or run the game, you cannot change the initial size anymore. You need to click 'Reset' to return to set up mode, to change the size. 'Stop' / 'Start' will pause and run the game. When paused you can change cells with the mouse like in set up mode. 'Reset' will kill all the current cells and return to the initial setup mode of the game. In cyclic mode this will randomize all the cells. 'Zoom' allows zooming to 7 possible values by clicking the button. 1x,2x,3x,4x,6x,8x and 10x the actual size. 'Grid' will display a grid over the cells. The grid can only be shown if the Zoom is greater than 2x. 'Color' This allows the colors used to be changed. Just click a color in the box to set it. Changing will cycle the colors or show only one color. By Count will set the color slightly different depending on the number on neighbors the cell has and the spread. 'Speed' Will change the game speed. The delay ranges from 25 ms to 800 ms. 'Rule' Allows you to enter you own rules for the game. You can change the rules for different modes either 2-D, 1-D or cyclic. 'Mode' will change the rules of the game. There are many modes, each with different rules. The rules are specified by the number of neighboring cells which allows the cell to survive and the number of neighboring cells which will cause a cell to be born. The rule for life is written as S23 B3. Some of the modes are:
You can read a deeper explanation of all the different rules here: Life like Cellular Automatons or a more complete list here: List of Life Variations Producing Gliders Most settings can be changed while the game is running or paused to create some intersting effects. What should I draw?
A simple shape to try in Life is called the F-Pentomino. This will generate many of the features you will read about in Game of Life articles, like Gliders which will slowly move in a diaganol line. It looks like this:
XX XX X In Crystal mode try one of these shapes to start:
XXXX X
XXX
XXXX X
In 2x2 this shape will end by producing an occilator with a period of 14( it takes 14 cycles to repeat itself): XXXX X X X X X XX X X X XX X X XXXX In Day and Night this shape is a period 11 occilator: X XXXX X XX XX X XXXX X In Seeds mode this shape gives an idea why its called Seeds: XX X In High Life mode, this shape will self replicate and can be used to run a 1-D automaton inside a 2-D automaton: XXX X X X X X X XXX Want more shapes to try? This link provides an alphabetical list of numreous patterns which have been explored in The Game of Life. Terms and Pattern Definitions for The Game of Life About This Program
This is my first attempt at programming John Conway's Game of Life. This version is using the new HTML 5 canvas element and javascript. It should run in any newer browser. Turning off the grid, reducing the size, single colors and reducing the zoom will all improve performance. I may add the ability to load and save preset games and figures in the future. The code is relatively efficient but I am sure it could be improved in many ways. I like the ability to change modes in the middle of the game, and the zoom feature was something new for me to code. I've always heard about this game but never really understood the fascination until I coded it. Absolutely amazing what such a simple program can draw.
If you would like to learn more about this program or make any recommendations or comments, please send me an email. Link is on the contact page.
If your interested in the source or a way to host the game on your own site, send me an email. As you can see after trying the program, it can be made to run like a small animated gif on a page. |
Copyright © OVAL Technologies 2012 Web Design and Hosting by