Game Of Life in 3 Lines of Code

Seeing Jop Wielens' implementation of Conway's Game of Life I wondered if I might be able to figure out a way how to run the whole game entirely with Flash's bitmapData methods. It turns out that it works, and it even works pretty fast. And at its core it just needs 3 lines of code:

calculationMap.applyFilter( gameMap, rect, origin, neighbourBlur ); calculationMap.draw( gameMap, null, colorAdd, "add"); gameMap.paletteMap( calculationMap, rect, origin, zero, zero, rules );

Of course a few objects have to get initialized once, but then it's really just these 3 lines that do all the work. Here you go - click the canvas and press any key to reinitialize the canvas with random values:

View the full source and download it here.