Silly, fun and useful things to do with Resolver One
  • HOME
  • About
  • Articles
  • Fun
  • Snippets
  • Disclaimer
  • Useful Links

Site by Voidspace

Email Michael

Download Resolver One

RSS Feed RSS Feed

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.

Site Built with rest2web

Creative Commons License

IronPython Wiki

IronPython in Action IronPython in Action

Conway's Game of Life

The 'game of life' in Resolver.

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.

  • Download the Resolver Game of Life (zipfile 2.9kb)

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:

# Modify these to change how the grid is created
height = 13
width = 36
startDensity = 0.2
cellSize = 20

To the right of the grid there are two buttons:

Recalculate and Reset 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.


Hosted by Webfaction

Return to Top

Last edited Tue Jun 12 23:37:40 2007.

Copyright ©2007 Michael Foord. All rights reserved. Design by Elemental Works. Logo by FuchsiaShock. Valid XHTML & CSS.

This work is licensed under a Creative Commons License.