Support and General Use > Plugins/Viewers
Game of Life
Yotto:
A game of life program I wrote (a long long time ago) had a border problem when reading files. Check for that. Anythign on the border of the file I read wouldn't give birth off the border on the first iteration. So your glider wouldn't create the dot below the bottom line, killing it.
Just a guess, may not be right.
man:
very nice, that there is so much interest in it.
My thought of the UI structure was:
start the plugin:
- menu
- edit mode
(a little zoomed in (maybe 3x3 cells?) where the selected cell is always in the middle,
so scrolling is done automatically by selecting another cell)
- play mode
(here the zoom and speed options apply, there is ony a need for play, pause,
and return to menu. Maybe scrolling for infinite fields?)
- import (rle and ascii-files)
- speed
- zoom
- quit
man
soap:
--- Quote from: Yotto on December 19, 2006, 05:46:26 PM ---A game of life program I wrote (a long long time ago) had a border problem when reading files. Check for that. Anythign on the border of the file I read wouldn't give birth off the border on the first iteration. So your glider wouldn't create the dot below the bottom line, killing it.
Just a guess, may not be right.
--- End quote ---
That is exactly what I was thinking, a test would be to import a world file such as:
--- Code: ---00000
00100
00010
01110
00000
--- End code ---
piquadrat:
I already tried that. The glider dies even if it is right in the center of the world... well, I'll probably implement edit mode today, perhaps "edited" gliders behave more to their nature :)
piquadrat:
Well, didn't quite make it to editor mode today. But zooming and and scrolling now works. Well, only for the iAudio X5, because I don't know how to set up a reasonable mapping for the other platforms. I'd appreciate suggestions from interested owners of other players :) As of now, the plugin needs buttons for scrolling in four directions, a quit button, a zoom button and a play/pause button. In the near future, a menu button will also be needed. Here's the iAudio X5 mapping:
--- Code: ---#elif (CONFIG_KEYPAD == IAUDIO_X5_PAD)
#define GOL_UP BUTTON_UP
#define GOL_DOWN BUTTON_DOWN
#define GOL_RIGHT BUTTON_RIGHT
#define GOL_LEFT BUTTON_LEFT
#define GOL_QUIT BUTTON_POWER
#define GOL_PLAY BUTTON_PLAY
#define GOL_SELECT BUTTON_SELECT
--- End code ---
man: good idea for the edit interface, I'll do it like that. Concerning infinite scrolling, I don't think that's possible. My X5 barely does 5 iterations per second with a bordered 160x128 world. Granted, my life-algorithm is the slowest imaginable and there are several much more efficient implementations with linked lists, bitvectors, lookup tables and whatnot, but that's just a little over my head right now ;)
[attachment deleted by admin, too old]
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version