Resolver Hacks contains information and code for doing fun and useful things with Resolver One. This site is created and maintained by Michael Foord, not by Resolver Systems. Please read the disclaimer before using any of the code on this site.
Conway's Game of Life

Conway's Game of Life is a fun 'cellular automaton', where single celled beings live or die depending on how crowded their surroundings are. The resulting pattern is both fun and mesmerising - seeming to have a life of its own.
Because Resolver has a cell based user interface, it is perfect for implementing 'the Game of Life' with; which is exactly what Jonathan Hartley has done.
The zipfile contains a single directory with several files in it. Unzip the whole thing somewhere onto your hard drive, and load Game_of_Life.rsl into Resolver.
Pressing F9 (recalculate) will calculate the next generation...
As well as being fun, this is an illustration of how easy it is to create a spreadsheet which actually does the processing in external Python files. All the game logic is contained in the file life.py, with lifeRsl.py preserving the state of the grid in between recalculations.
You can control the size of the grid (the number of cells wide and high), and the size of each cell, by modifying the constants near the start of the code:
height = 13
width = 36
startDensity = 0.2
cellSize = 20
To the right of the grid there are two buttons:

The recalculate button causes a recalculate by cheating (not recommended for production code)! It sends an 'F9' using the Windows Forms SendKeys.Send method. The reset button resets the grid using the correct technique, and then sends an 'F9' so that you can see the change.
Have fun.
Last edited Tue Jun 12 23:37:40 2007.

IronPython in Action