Conway's Game of Life

BlitzMax Forums/BlitzMax Tutorials/Conway's Game of Life

Sloan(Posted 2006) [#1]
I have written a small application with a large amount of comments for Conway's Game of Life. If you don't know what that is, visit here -> http://www.math.com/students/wonders/life/life.html . The source code (everything you need) can be downloaded here -> http://www.sloankelly.net/blitzmax/files/life.zip . Sorry there are no piccys, the math.com site above explains it rather well (The real reason there are no piccys? I can't remember how I got pictures to work on here - 1000 apologies!)


WendellM(Posted 2006) [#2]

I can't remember how I got pictures to work on here

Just posting a pic's URL does the trick, or see "What are the forum codes?" for the formal (img) way.

Also, both of your links in the above post have minor problems due to the forum including the final period/full stop in a sentence as part of the URL link (though most folks will presumably spot that and remove the offending punctuation at the end). I've developed a habit of putting a space between the URL and any trailing punctuation when posting (if not using the [a] business).

But, all that's fiddly stuff. The main point is that you shared a BMax version of Conway's Life, which is a Good Thing <g>.


Sloan(Posted 2006) [#3]
@WendellM: Thanks for the tips! I knew there was a way to do it. My excuse is that it was late at night / early morning!! Anyway, here goes, a screen shot:




Sloan(Posted 2006) [#4]
And there is a bug...

Change the GM_NextFrame function to the one below. I noticed this after my last post. I broke one of the rules. If a cell has exactly three neighbours it stays alive OR gives birth. I noticed there was a problem when I tried to do a glider. It didn't work! So here's the updated function.




amonite(Posted 2006) [#5]
thanks for porting this to blitzmax and sharing it as a tutorial :) Conway's game of life is really fascinating.


Sloan(Posted 2006) [#6]
I'm in the process of writing up a doc - not just the comments in the code - and I'll upload that on my site here. I had Life on the "Horizons" tape that I got with my ZX Spectrum and I loved playing with it! So, I decided to give it a go and program it myself. Doesn't hurt the fact that AI is part of my masters course ;o)