This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

tkiesel
tkiesel presents ...

2009/4/10

Conway's Life

Conway's Life in Greenfoot

A 2 dimensional cellular automaton. Each cell is "dead" or "alive".
The next step of the simulation is determined by these rules (via Wikipedia):

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 dead cell with exactly three live neighbours becomes a live cell.

The space is modeled as a toroid (donut), so the cells are on a finite but boundless surface. The top connects to the bottom, and the left connects to the right.

GUI buttons control the Simulation.
Start runs the simulation
Stop pauses the simulation
Rand populates the simulation with random cells
Blank pauses and clears the simulation, so you can draw your own configuration.

Use the left-click of the mouse to draw cells.

TO DO:
Check for simple (period of 2) steady state and pause simulation until perturbed?

6121 views / 5 in the last 7 days

4 votes | 0 in the last 7 days

Tags: mouse simulation with-source life conway cellularautomata al ca cellularautomaton gui

open in greenfoot
Your browser does not support the canvas tag.
mjrb4mjrb4

2009/4/11

Ooh :-) I've no idea what's actually happening, but it looks cool!
tkieseltkiesel

2009/4/11

Check the listed webpage for the scenario. It's the Wikipedia entry for Conway's Game of Life. http://en.wikipedia.org/wiki/Conway's_Game_of_Life Basically, each cell is either "alive" or "dead". On each iteration, a set of simple rules is applied to each cell to see if that cell will be "alive" or "dead" next turn. To quote Wikipedia's summary of the rules: 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 dead cell with exactly three live neighbours becomes a live cell. The fascinating thing is that this simulation is itself capable of being a Turing complete computer!
A new version of this scenario was uploaded on Sat Apr 11 16:05:53 UTC 2009
tkieseltkiesel

2009/4/11

Added GUI buttons to control the simulation, including a button to clear the sim and allow the user to draw their own patterns.
tombud999tombud999

2009/4/11

Cool! This is nice! Long time ago I played the windows versions, still remember some of the special cells group shapes such as glider (L plus a cell on its foot tip) that "glide" to one direction, the I (three cells in a row) that flip-flop vertical-horizontal, etc.
A new version of this scenario was uploaded on Sat Apr 11 17:16:00 UTC 2009

Want to leave a comment? You must first log in.

Who likes this?

birdy Yoinkinator Matze tombud999