This is your average Game of Life simulator, except super optimized, and with a potentially infinite playground (until your ClassPad runs out of memory of course ). The algorithm was shamelessly stolen from this: http://www.ibiblio.org/lifepatterns/, so most of the credits should go to the author of this Java applet. It is quite efficient and runs at a decent speed, at least for rules that aren't too chaotic. I slightly modified it to support weighted and binary rules as well.
First button allows you to go back one generation. Unfortunately, even though this Life algorithm is quite awesome, it can't do miracles, so only one generation is memorized, basically you can use this only once.
Second button is somehow obvious, click it to start the simulation. Once started, it turns into a Pause button, and you can click it again to pause the simulation. You can press EXE as well to start/stop a simulation.
Third button brings you one generation forward. Use this for step by step simulation, if you want to observe how certain patterns evolve.
Fourth button toggles between add and remove modes. By default, drawing on the screen adds live cells (add mode). In remove mode, the stylus... removes cells. As simple as that.
Additionally, you can press the + or - buttons to zoom in or zoom out. x2, x4 and x8 zooming modes are available.
Of course, you can load and save your patterns using File > Load and File > Save. Exiting also creates an automatic save, which is loaded when you start the add-in again. You can also import patterns from pictures using File > Import, although the picture should be saved in OS2 format. You can do that with the Bitmap Editor app (http://www.classpad....hp?id=326&cat=3). Since OS3, most pictures are saved in a compressed format, and I didn't really bother looking into them yet.
Exporting patterns isn't possible yet, unfortunately, because I don't know how to handle situations where you left a glider gun running for one hour and the resulting picture ends up being 8000x8000, with 99% of empty space.
Setup > Grid lets you toggle the grid on and off. It is on by default, but you obviously can't notice it because it is only available in x4 and x8 zoom modes.
And finally, you can add rules using Setup > Rules. Select a rule and tap the - button to remove it, enter a rule in the text box and tap the + button to add it to the list of saved rules. The classic syntax for rules is the following:
survival conditions/birth conditions (comment goes here)
Classic one:
23/3 (Life)
I have added support for two other types of rules which give pretty interesting results. The first of them is Weighted rules.
The syntax and detailed explanations for those can be seen here: http://psoup.math.wi...ullex_wlif.html. You should add W at the beginning of a rule to specify that this rule is a weighted rule. Also, the HI flag is unsupported so you should remove it.
Weighted rules assign a weight to each neighbour, so the survival and birth conditions may be higher than 8. Most rules available in the above link should work, except those with a history flag higher than 0.
For instance the first rule on the above page looks like this:
NW3,NN2,NE3,WW2,ME0,EE2,SW3,SS2,SE3,HI0,RS3,RS5,RS8,RB4,RB6,RB8
On the CP, it should look like this:
WNW3,NN2,NE3,WW2,ME0,EE2,SW3,SS2,SE3,RS3,RS5,RS8,RB4,RB6,RB8
Basically, remove the HI part and add a W at the beginning, as simple as that.
The second category of special rules is Binary rules.
Detailed explanations here: http://psoup.math.wi...ullex_gebi.html. Only rules that start with C0 (no additional state) will work. You should remove that part as well.
First rule on the above link looks like this:
C0,NN,S3babbabbabba3b,B7ab3aba3b
You should write this on the CP:
NN,S3babbabbabba3b,B7ab3aba3b
I think that's it, enjoy! Keep in mind that this is still kind of experimental, so some feature might not be crash-proof. I might get back to this project later, if there are interested people.
Edited by Kilburn, 31 January 2011 - 02:00 PM.