Support and General Use > Plugins/Viewers

Game of Life

<< < (4/6) > >>

piquadrat:
Burned another few hours today :) edit mode now works and worlds loaded from a file behave like they should (I attached a glider gun in the file world.gol). Also, there's a menu now.

To try out the file loading, put this in a text file, save it to .rockbox/rocks/world.gol an watch what happens when you load it :)


--- Code: ---0
0
0
00000000000000000000000000001
00000000000000000000000001111
000000000000000010000000111100000000011
000000000000000101000000100100000000011
0001100000000010001100001111
00011000000000100011000001111
00000000000000100011000000001
000000000000000101
00000000000000001
--- End code ---

(you probabely have to save it in unix format with an editor like notepad++)

There are also developments on the performance. I found quite an involved C++ implementation of the game of life in the book "Graphics Programing Black Book" by Michael Abrash (chapter 17, PDF file) and integrated it into my code. This thing flies! Actually, it's so fast that displaying the viewport becomes the bottleneck. Unfortunately I don't have any idea under which license this code is, so I can't post it yet.

In the mean time, here's the newest version with the slow implementation (still no button mappings other than for the X5  :-[):

[attachment deleted by admin, too old]

linuxstb:
They're not perfect, but here is a quick attempt at an ipod keymapping:


--- Code: ---#define GOL_UP BUTTON_MENU
#define GOL_DOWN BUTTON_PLAY
#define GOL_RIGHT BUTTON_RIGHT
#define GOL_LEFT BUTTON_LEFT
#define GOL_QUIT BUTTON_SELECT | BUTTON_MENU
#define GOL_PLAY (BUTTON_SELECT | BUTTON_PLAY)
#define GOL_SELECT (BUTTON_SELECT | BUTTON_REL)
#define GOL_EDIT (BUTTON_SELECT | BUTTON_RIGHT)

--- End code ---

Chronon:
That's awesome.  I'll be really happy to have this as a plug-in.  Keep up the good work!

Mad Cow:
I got a data abort at 000043A4 when I tried this on my H10.

I also have a quick keymap for the H10
--- Code: ---#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define GOL_UP BUTTON_SCROLL_UP
#define GOL_DOWN BUTTON_SCROLL_DOWN
#define GOL_QUIT BUTTON_POWER
#define GOL_LEFT BUTTON_LEFT
#define GOL_RIGHT BUTTON_RIGHT
#define GOL_PLAY BUTTON_PLAY
#define GOL_SELECT BUTTON_FF
#define GOL_EDIT BUTTON_REW
--- End code ---

piquadrat:
Mad Cow: when does it abort? When you start the plugin, when you initialize a world or while "playing"?

I still haven't found information concerning the license of that optimized algorithm. I contacted the author, Michael Abrash today, let's see if that ancient email address still is active :) In the mean time, I benchmarked the two algorithms by letting them iterate 500 times over a 40% filled random world. With the old algorithm, my X5 spends about 14'000 ticks in the game_step method. Michael Abrash's code cuts that number down to less than 700 ticks! Displaying the world after each iteration adds up to another 2700 ticks.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version