Jump to content



Photo
- - - - -

Life V.0.1


  • Please log in to reply
3 replies to this topic

#1 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 31 January 2011 - 01:59 PM

This is a quite old project of mine, and honestly, I haven't worked on it for two years even though it's working perfectly fine. Thought I'd release it just in case anyone is interested, but keep in mind that it's somehow incomplete (I planned a bunch of features for it, but eventually lost interest and never implemented them).

Posted Image Posted Image Posted Image Posted Image

Download here!


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 :rolleyes: ). 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.

Posted Image

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: :P

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! :lol: 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.


#2 MicroPro

MicroPro

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 640 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    Casio ClassPad 300

Posted 06 February 2011 - 10:27 AM

Nice work! I've got addicted it! :lmao:
But i wonder if you have a bit time to make the text box in the Rules dialog bigger?
And a question: Is there any limit on how big the numbers can be in weighted mode? For example NN1000,NW12034,EE12984,etc is possible?

#3 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 07 February 2011 - 09:48 PM

Nice work! I've got addicted it! :lmao:
But i wonder if you have a bit time to make the text box in the Rules dialog bigger?
And a question: Is there any limit on how big the numbers can be in weighted mode? For example NN1000,NW12034,EE12984,etc is possible?


Calculations are done on a signed integer, so the limit should be around 2 billions. Although I really doubt you need such huge weights. :lol:

Also, I was planning to add an interface for easily entering weighted and binary rules, but since the ClassPad community is kind of dead... :(
Should I do it anyway?

Edited by Kilburn, 07 February 2011 - 09:49 PM.


#4 Elihu5991

Elihu5991

    Newbie

  • Members
  • Pip
  • 12 posts

  • Calculators:
    Classpad 330

Posted 24 September 2011 - 11:55 AM

If your looking at promoting your add-in to potentially interested people. Let me know, I can help you. I currently can't use it now, but your add-in looks amazing!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users