[Staff][Beta] Conway's Game of Life!
Posted: Wed 28 Feb, 2007 6:51 pm
You may have heard of "Conway's Game of Life" before, if not, well it is possibly the most famous example a cellular automaton. It was initially thought up by the British mathematician John Horton Conway in 1970.
Basically what you do is take every pixel on the screen and apply the following rules:
1: Any live cell with < 2 neighbours dies of loneliness
2: Any live cell with > 3 neighbours dies of overcrowding
3: Any dead cell with exactly 3 neighbours is bought to life
4: Any live cell with 2 or 3 neighours remains unchanged
Note: births and deaths can occur during 1 generation
More information can be found here: http://en.wikipedia.org/wiki/Conways_Game_of_Life
Simply put, you can make patterns that evolve into stuff .
Sounds easy enough? But testing the 8 surrounding pixels for the 6144 pixels on the calc screen isnt ever going to be lightning fast. Iambian came up with an implementation a little while ago that involved some genius shifting and such, and he managed to get things running at a decent speed.
For some reason he mentioned it on IRC, that he would like to see it faster but didnt know if that was likely. I couldnt get this conway's thing out of my head so i had a go. With the aid of some page-aligned LUT's and some optimising i managed to get an implementation going. Making me happy that it actually works, and even happier that it runs at a decent speed.
I slapped some PIC loading in and a cheap titlescreen and it seems to be all done. I was just wondering if anyone wanted to test it for me? Just indicate in this thread if you do, state your email address and i will send it to you.
Screenshots:
Basically what you do is take every pixel on the screen and apply the following rules:
1: Any live cell with < 2 neighbours dies of loneliness
2: Any live cell with > 3 neighbours dies of overcrowding
3: Any dead cell with exactly 3 neighbours is bought to life
4: Any live cell with 2 or 3 neighours remains unchanged
Note: births and deaths can occur during 1 generation
More information can be found here: http://en.wikipedia.org/wiki/Conways_Game_of_Life
Simply put, you can make patterns that evolve into stuff .
Sounds easy enough? But testing the 8 surrounding pixels for the 6144 pixels on the calc screen isnt ever going to be lightning fast. Iambian came up with an implementation a little while ago that involved some genius shifting and such, and he managed to get things running at a decent speed.
For some reason he mentioned it on IRC, that he would like to see it faster but didnt know if that was likely. I couldnt get this conway's thing out of my head so i had a go. With the aid of some page-aligned LUT's and some optimising i managed to get an implementation going. Making me happy that it actually works, and even happier that it runs at a decent speed.
I slapped some PIC loading in and a cheap titlescreen and it seems to be all done. I was just wondering if anyone wanted to test it for me? Just indicate in this thread if you do, state your email address and i will send it to you.
Screenshots: