Had this idea today Conway's Game of Life on a BitmapData Object. Each pixel is a cell. I'll release the source code when I refactor and comment it.
Rules:
1. Any live cell with fewer than two live neighbours dies, as if 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 on to the next generation.
4. Any dead cell with exactly three live neighbours becomes a live cell.
great post as usual
looking forward to the source code
Very nice. I’m also looking forward to the source.
Hey, why don’t you allow the user to fill pixels with the cursor?
Sheer laziness on my end :) I shall add it before releasing the source, good idea, thanks.
hey how do you do the randomise?
Hi Helen,
I run through the grid with a nested for loop and roll a random, if it is < 0.2 I fill the cell.
for(var i:Number = 0; i<ROWS-1;i++){
for(var j:Number = 0;j<COLUMNS-1;j++){
if(Math.random()<=.2) { fillCell(i,j); }
}
}
^code might have an issue with the borders and corners, I'll get you the right one when I get back home.