gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Misc > DSlife 2 (other one is broken!)

#110943 - Jeremysr - Sun Dec 03, 2006 2:47 am

The original one I released had an invisible bad bug in it that made almost all cells die unless you drew really slowly. This one fixes that and adds some more features described in readme.txt which I'll quote.

readme.txt:

Quote:
DSlife by Jeremysr
jeremy.ruten@gmail.com
------------------

What is Conway's Game of Life? Go here to find out: http://en.wikipedia.org/wiki/Conways_life

DSlife follows the same rules as Conway's Life. It comes in three versions: 32, 64, and 256. These numbers are the width of the array of cells in the game of life.

DSlife_256: 256x192 cells, each cell is 1x1 pixel
DSlife_64: 64x48 cells, each cell is 4x4 pixels
DSlife_32: 32x24 cells, each cell is 8x8 pixels (most accurate for creating life patterns)

With DSlife_256, you can draw on the screen to create life, but the only way of erasing life is to clear the whole screen. With DSlife_64 and DSlife_32, you tap the screen to create 1 life cell at a time, or, if the cell already has life on it, erase that life.

Menu:

Start simulation - Starts the life simulation after you have drawn life on the screen
Clear screen - Destroys all life making the screen white
Speed - Changes the speed ranging from 0 to 9. 0 being the slowest, 9 being as fast as the DS can go. (Which isn't too fast :( )
Rules - Changes the rules of life. There are 10 preset rules, the default being normal life (23/3).
Save to... - Saves the speed and rules and life array currently being shown on the bottom screen to a file on the root of the card (DSlife_32.life, DSlife_64.life, or DSlife_256.life). If they don't exist DSlife will create them. You can only save one at a time. To edit them on the computer, open them in a text editor and from line 2 to the end of the file is the life array. 0's are dead (white) and 1's are alive (black).
Load from... - Loads the speed and rules and life array from a file (DSlife_32.life, DSlife_64.life, or DSlife_256.life) on the root of the card.

All of the menu options are selected or toggled using the A button.

In this directory there are DSlife_*.life savefiles that you can put in your root directory:

DSlife_256.life - Gosper's Glider Gun pattern
DSlife_64.life - Diehard pattern
DSlife_32.life - Glider pattern

---

Thanks to felix123 for the variable speed and lid checking code!


Download: http://www.bio-gaming.com/jeremy/dslua/downloads/DSlife2.rar

#110950 - dantheman - Sun Dec 03, 2006 5:27 am

Hm, this sounds like a very cool thing. Just tried a Java applet linked to from the Wikipedia site and found it to be a very fun thing to watch. This is definitely going into my favorites list.

One question: will it be possible at some point to allow for adding a life cell while the simulation is running? The java applet I tried at http://www.bitstorm.org/gameoflife/ did this, and it was pretty cool to see the little trail of life that would follow my mouse cursor.

#110953 - Jeremysr - Sun Dec 03, 2006 5:40 am

That's a good idea. I might try it, but it would probably make the simulation pretty slow (so it'd be an option). But it should be slow when you draw while running I guess, since otherwise (like I noticed in that java applet) the life will die before you have a chance to draw more.