You should add some buttons to populate the grid with some of the more well known of the game's denizens. Perhaps let the user select from a list of patterns, then insert that pattern when the grid is clicked instead of toggling an individual cell.
See the excellent http://www.conwaylife.com/wiki/ for some ideas. That site also has its own RLE syntax for defining the patterns, so maybe you could crawl it and allow the user to use any of the 600-odd patterns they have on there.
That site brings back good memories from uni, I spent a long time converting iterations of GoL grids into MIDI notes and piping them to synths to make generative acid house.
I had this feature in mind since I started working on this, and it's definitely what I will implement next. I will also add the ability to resize the grid to fit some of the larger patterns.
This will probably require a rewrite of the current "nextGen()" algorithm, perhaps a quadtree implementation in Javascript or implementing some of the optimizations suggested in Chapters 17 and 18 of Michael Abrash's Graphics Programmer's Black Book.
There were never any MIDI files, the notes were generated as raw bits and sent straight into ableton live, which is a full blown software music studio. The notes then drove a softsynth which noodled away over various drum loops playing in live.
Because I had no desire to work out how to send clock data back from live into my hacked bit of ruby code, I simply sent MIDI clock signals from my code along with the note data. This meant that the iterations of the GoL were controlling the speed of live's sequencer.
As my code was very naive, it simply did its calculations, sent the notes and then did sleep(0.5) or something, then started the next iteration. This, along with ruby's garbage collection meant that the time taken for each iteration, and the delay between each MIDI clock signal, varied considerably.
All of this added up to a situation where the master clock in live was constantly wandering up and down by about 20bpm either way. Now remember I said that live was playing the drum tracks underneath? Live timestretches audio to the BPM of the master clock, so the whole track was constantly wavering in tempo. The whole thing sounded like an early 90s warehouse party aboard a pitching and rolling ship. Which is incidentally how I usually feel at warehouse parties.
At some point I plan to post the music with the code to my blog, along with all the other wacky shit I did at uni.
I’ve been always wondering, with all this variety, can the Game of Life model such a simple process as a circular wave? I can’t find anything about that.
"It is possible to build a pattern that acts like a finite state machine connected to two counters. This has the same computational power as a universal Turing machine, so the Game of Life is theoretically as powerful as any computer with unlimited memory and no time constraints: it is Turing complete."
I love the fact it's an 'around the world' canvas. Most implementations I've played around with use an expanding or fixed width one instead...it makes some combinations truly amazing.
For example, the acorn pattern(http://en.wikipedia.org/wiki/File:Game_of_life_acorn.svg) is a lot more impressive, because the gliders spawned travel across the screen and interact with the solid blocks. Empirically, it seems to make the pattern last a lot longer!
Absolutely fantastic! I've never seen an interactive game of life before. It's a revelation. To be able insert a single pixel and see what happens is really, really cool.
The funniest thing about GOL is that the harder you try to make things live, quicker you kill it off. How can 4 simple rules develop such poignant insights?!
Continuing with the here's mine: http://gkatsev.com/gameoflife.js/index.html
I wrote this a few months ago. It's fairly similar to the post's one but I have a few presets as well as the ability to share.
Also, as mentioned above about the MIDI I plan on making it into a step sequencer using the new js audio APIs but have not had a chance to do so yet.
Why use canvas for this when plain divs could do the job more easily and more efficiently, with wider browser compatibility? Simply for buzzword compliance?
When we developed swarmation.com we started with canvas and later switched to plain divs. Not only did we manage to throw out most of the code in the switch, things also ran much more smoothly and worked in IE as well.
Don't get me wrong, I'm all for cool new tech, and canvas definitely has its uses. But we should be helping people recognize when plain HTML or SVG are more appropriate, rather than being buzzword-driven.
Because manipulating a document with thousands of divs is really slow?
Seriously. Like most people in this thread I've made 'life' on the web with both divs and canvas. The implementation using canvas is significantly faster and can even handle huge grids.
See the excellent http://www.conwaylife.com/wiki/ for some ideas. That site also has its own RLE syntax for defining the patterns, so maybe you could crawl it and allow the user to use any of the 600-odd patterns they have on there.
That site brings back good memories from uni, I spent a long time converting iterations of GoL grids into MIDI notes and piping them to synths to make generative acid house.