Author Topic: [Lua] Cellular Automata  (Read 11886 times)

0 Members and 1 Guest are viewing this topic.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
[Lua] Cellular Automata
« on: January 15, 2013, 08:48:02 pm »
Cellular Automata

http://www.omnimaga.org/index.php?action=downloads;sa=view;down=843

This is an Nspire Lua version of Cellular Automata.

Features:
 - choose the fieldsize yourself
 - choose the number of generations that pass automatically (when it stops, you can go to the next gen with [enter]
 - choose the framerate at which the generations pass
 - toggle wraparound. When enabled, one row below the field's bottom row is the top row. That way with all the borders (The field never stops). When disabled, the field stops at the screenborders.
 - add standard states from a menu (glider, cross, Diagonal egg, Exploder, Dieing exploder r-Pentamino and Glidergun).
 - toggle tiles on the field using [tab] in edit mode

If you stop the animation with [esc] you go back to the starting positions.
Press [esc] again and you're back in the main menu. As long as you don't change the field size, all data is contained.
No saving option is implemented yet. When you quit the program, you lose the data.

11 sets of rules supported, select them, and many more options, with [menu].

« Last Edit: January 16, 2013, 07:35:01 am by Nick »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Conway's Game of Life
« Reply #1 on: January 15, 2013, 09:04:55 pm »
Hmm nice, I gotta give this a try at some point. Does it support 320x240 grid? :P

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Conway's Game of Life
« Reply #2 on: January 15, 2013, 09:08:47 pm »
We both made the game of life at the same time :P
Here's mine btw

Only difference is that mine is in C and I don't attach the top-bottom/left-right edges like nick does.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Conway's Game of Life
« Reply #3 on: January 15, 2013, 09:10:44 pm »
Hmm nice, I gotta give this a try at some point. Does it support 320x240 grid? :P
No, for two reasons:
1. It is written in apilevel 1.0, so it does not support fullscreen (max of 318x212px)
2. It took way too long to calculate it for a big screen, that's why I put a restriction on it. This restriction might be stupid, but when I ran it w/o it on my pc, it started ventilating like hell, and I didn't dare to try it on calc.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Conway's Game of Life
« Reply #4 on: January 15, 2013, 09:16:59 pm »
I could do that actually :P
'twould be easier to do that with ndless

Edit: Here ya go :P
https://dl.dropbox.com/u/93019118/life_full.tns
« Last Edit: January 15, 2013, 09:31:58 pm by epic7 »

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Conway's Game of Life
« Reply #5 on: January 15, 2013, 10:49:53 pm »
Looks interesting, but what is this game of life?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Conway's Game of Life
« Reply #6 on: January 15, 2013, 11:42:21 pm »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Conway's Game of Life
« Reply #7 on: January 15, 2013, 11:44:20 pm »
Ah, that is a very interesting consept! :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: Conway's Game of Life
« Reply #8 on: January 16, 2013, 01:29:16 am »
Looks awesome, there are some 83+ variations as well. I believe Iambian has one on these forums somewhere.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: Conway's Game of Life
« Reply #9 on: January 16, 2013, 01:48:12 am »
Indeed, Conway's Game of Life is a classic learning exercise which can produce nifty patterns, there are many implementations for pretty much any platform :)
The ticalc.org archives contain several dozens of implementations, among which are:
http://www.ticalc.org/archives/files/fileinfo/338/33898.html (best TI-68k implementation, fast and multiple rules supported, documentation - if you want a source of inspiration for expanding the feature set of your program, this one is fantastic)
http://www.ticalc.org/archives/files/fileinfo/144/14483.html (TICT's simple implementation, hard-coded 23/3 rule, for the TI-68k series) / http://www.ticalc.org/archives/files/fileinfo/434/43471.html (my Nspire Clickpad/Touchpad Ndless 1.7/2.0 port)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: Conway's Game of Life
« Reply #10 on: January 16, 2013, 01:56:27 am »
There are also some z80 implementations:

Iambians which supports multiple rules etc: http://www.ticalc.org/archives/files/fileinfo/445/44578.html

And i have one also that i made in a hurry (http://www.ticalc.org/archives/files/fileinfo/397/39705.html)
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Conway's Game of Life
« Reply #11 on: January 16, 2013, 02:02:39 am »
Looks awesome, there are some 83+ variations as well. I believe Iambian has one on these forums somewhere.
That would be here and features a bazillion alternative rulesets he also explains his method somwhat to acheive such performance.
If we are sharing examples, Patrick Pendergast (tr1p1ea) wrote a Conway's Game of Life program. :P


EDIT: Dang, I was ninja'd >.> My computer died mid-post, but Chrome saved the majority of it XD

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Conway's Game of Life
« Reply #12 on: January 16, 2013, 05:25:56 am »
I decided to implement all those from wikipedia, since those are the ones in that 68k game too i think.
there are 11 rules in total: Conway, replicator, replicator2, seeds, flakes, 34 Life, Diamoeba, 2x2, highlife, day&night and morley.
You can set them with the [menu] key.

Of course I changed the name to Cellular Automata :)

I only have some problems with those menu's. It seems that when I change it, the contents and th functions behind the menu change, but not the text and layout of the menu. That way you can't see what you're doing, you always see the same menu, and I have no clue what's going on...
I'll update it as soon as I get this fixed

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [Lua] Cellular Automata
« Reply #13 on: January 16, 2013, 07:38:51 am »
Updated!

Now 11 different rules are supported, select with [menu].
Download is also updated, toghether wih the youtube vid.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [Lua] Cellular Automata
« Reply #14 on: January 16, 2013, 08:18:12 am »
Relayed to the community at TI-Planet, like I did with your Uno game several weeks ago: http://tiplanet.org/forum/viewtopic.php?t=11117 .

How about adding a Cellular Automata item to the image in your signature ? :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.