RIP John Conway
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 265
- Joined: Sat Aug 16, 2008 9:48 am
- Location: Stockholm, Sweden
- Contact:
Re: RIP John Conway
Oh, just one problem I noticed in your version, Thierry: The pause button doesn't work now, it instantly switches to 'play' again. Commenting out the lines 180-181 in card script fixes that. But then instead it won't stop at no-change status, so some further code is needed to restore full play/pause functionality.
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Re: RIP John Conway
Mmm, must have zipped the wrong one, as it works fine here
Otherwise how could I have the results I did show in my previous post
I'll upload another one later on...
Thanks
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
Re: RIP John Conway
Thanks Andreas,
But honestly, I read your code first and then made the changes;
so most merits for you
Oh, I was expecting that you get caught into itFaster than that and it would be hard for the eye to follow the pattern changes,
which would make it less entertaining to watch.
and wanted to do some more improvement....
If it becomes too fast, then add a scroller to your UIs to manage the timer
in the main loop: send "NextGeneration" in timer milliseconds.
Thanks for sharing your stack,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
Re: RIP John Conway
here is a new version correcting the bug mentioned by Andreas.
For those who have already downloaded the 1st,
you can edit the card script
and modify it this way:
-- drop the send "mouseUp" to widget ...
-- comment out: set the iconPresetName of widget "PlayPause" to "play"
-- and further down, replace: if cellsChange[ X][ Y] is not empty then
-- by: if cellsChange[ X][ Y] then
New code:
Thanks,
Thierry
For those who have already downloaded the 1st,
you can edit the card script
and modify it this way:
-- drop the send "mouseUp" to widget ...
-- comment out: set the iconPresetName of widget "PlayPause" to "play"
-- and further down, replace: if cellsChange[ X][ Y] is not empty then
-- by: if cellsChange[ X][ Y] then
New code:
Code: Select all
if isAnyChange and \
the iconPresetName of widget "PlayPause" is "pause" then
send "nextGeneration" to me in 1 ticks
else
-- no change happens on the entire board: Stop!
-- or user press the 'PlayPause' button
beep 2
set the iconPresetName of widget "PlayPause" to "play"
show grp "OtherButtons"
end if
end nextGeneration
command displayNextGenerationDelta @cellsChange
lock screen
repeat with X = 1 to N_COLUMNS
repeat with Y = 1 to N_ROWS
if cellsChange[ X][ Y] then \
cellNewState board[ X][ Y][_ID], board[ X][ Y][_NEXT]
put board[ X][ Y][_NEXT] into board[ X][ Y][_NOW]
end repeat
end repeat
end displayNextGenerationDelta
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
Re: RIP John Conway
Hi, I wanted to take up the issue with the different facebook groups etc. and the question of consolidating different silos of knowledge. It appeared earlier in this thread but it felt impolite to continue this discussion here since this thread is dedicated to John. I started a new one here. https://forums.livecode.com/viewtopic.p ... 23#p191891
Chime in if you feel like. Thanks. Oliver
Chime in if you feel like. Thanks. Oliver
-
- VIP Livecode Opensource Backer
- Posts: 265
- Joined: Sat Aug 16, 2008 9:48 am
- Location: Stockholm, Sweden
- Contact:
Re: RIP John Conway
Oh, I would like to for sure! But I have so many projects going on, so this one will have to rest for a while...
You are of course right that "too fast" is never a problem, as it can just be slowed down if needed.
Other things on the improvement list could be:
- better boundary handling (the array could extend beyond the visible grid and handle life/death events correctly there)
- allow the user to modify the size of the window and the grid (I made it quite big as I have a large external screen, but it doesn't actually fit on my laptop screen)
- "painting" dots . i.e. drag mouse to turn them on/off, instead of clicking on each
- "stamping" or moving predefined seeds anywhere on the grid, instead of them just appearing where they where saved
- recording/logging every step to enable stepping backwards to interesting points in time
etc..
I'm sure the most advanced simulators (and there must be thousands, as Game of Life seems to be a popular exercise in all programming languages) have all these features and a bunch more that I fail to imagine.
Maybe someone else in the LC community wants to carry the baton and advance our joint stack up the feature ladder?
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Re: RIP John Conway
Same for me.
My interest when I came in, was to improve the speed of the core game;
well, I've done my job, refreshing old knowledge in the process
All those features are quite easy to implement...Other things on the improvement list could be:
- better boundary handling (the array could extend beyond the visible grid and handle life/death events correctly there)
- allow the user to modify the size of the window and the grid (I made it quite big as I have a large external screen, but it doesn't actually fit on my laptop screen)
- "painting" dots . i.e. drag mouse to turn them on/off, instead of clicking on each
- "stamping" or moving predefined seeds anywhere on the grid, instead of them just appearing where they where saved
- recording/logging every step to enable stepping backwards to interesting points in time
etc..
of course with some time.
Actually, it's a nice project for those wanting to learn deeper LiveCode.Maybe someone else in the LC community wants to carry the baton
and advance our joint stack up the feature ladder?
So, who's the next ?
Best,
Thierry
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: RIP John Conway
I'm not sure boundary handling is so much of an issue. I envisioned a bounded infinite surface where exiting from one edge would enter the opposite one. That way it sort of maps the playing field onto a hypersphere.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 265
- Joined: Sat Aug 16, 2008 9:48 am
- Location: Stockholm, Sweden
- Contact:
Re: RIP John Conway
Yes, that's one solution. If I remember correctly (I read up a little on Game of Life theory back in February when this came up in the FB group), the common ways of handling the boundary are:
- No handling, just treat all cells outside the boundary as permanently dead (this is the 'lazy' way, and the way I did it).
- Handle outside cells by making the virtual grid (the array where stuff is computed) larger than the visual one, so that e.g. gliders exit correctly.
- Treat the area as a hypersphere where e.g. exiting gliders enter on the opposite side (like you describe it).
- 'Follow the action', where the visible area 'moves' with a glider so that it never exits (hard to determine which action to follow though, if several objects are developing in different directions...).
In the best simulator, all of them would be implemented, and you can choose at any moment which one you want to test.
Last edited by SWEdeAndy on Thu May 21, 2020 8:21 pm, edited 1 time in total.
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: RIP John Conway
Ha!In the best simulator, all of them would be implemented, and you can choose at any moment which one you want to test.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 265
- Joined: Sat Aug 16, 2008 9:48 am
- Location: Stockholm, Sweden
- Contact:
Re: RIP John Conway
Just reviving this old thread to post the link to the freshly web deployed LC GoL implementation:
https://wheninspace.com/gameoflife/
The only adaptation I have made is changing the save function for custom seed patterns from local text file to browser local storage.
I also threw in a new feature for importing RLE code (a common GoL seed pattern format).
It doesn’t have responsive design, so a large screen is recommended.
It does work on mobile though (at least iOS), albeit being a bit slow (and you'll obviously need to scroll around to see things).
Depending on your processor capacity, the web browser may choke and stall on the fast progression rate, so you may then need to enter a longer millisec delay value in the appropriate field and try again.
(As reference: On an iPad 6th gen a 600 millisec delay is needed, while on a Mac Studio M1 Max just 40 millisecs is fine.)
Have fun!
https://wheninspace.com/gameoflife/
The only adaptation I have made is changing the save function for custom seed patterns from local text file to browser local storage.
I also threw in a new feature for importing RLE code (a common GoL seed pattern format).
It doesn’t have responsive design, so a large screen is recommended.
It does work on mobile though (at least iOS), albeit being a bit slow (and you'll obviously need to scroll around to see things).
Depending on your processor capacity, the web browser may choke and stall on the fast progression rate, so you may then need to enter a longer millisec delay value in the appropriate field and try again.
(As reference: On an iPad 6th gen a 600 millisec delay is needed, while on a Mac Studio M1 Max just 40 millisecs is fine.)
Have fun!
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Re: RIP John Conway
Nice!
Seems to stall completely at 168 generations though (M2 Pro)
Seems to stall completely at 168 generations though (M2 Pro)
-
- VIP Livecode Opensource Backer
- Posts: 265
- Joined: Sat Aug 16, 2008 9:48 am
- Location: Stockholm, Sweden
- Contact:
Re: RIP John Conway
There may be more factors involved that decide how your setup copes with it. I’m not seeing any hard limit like that, but if it starts to lag it tends to stall soon after.
Try upping the delay value until you find a level that allows running ‘forever’ (some patterns have static end states of course).
Try upping the delay value until you find a level that allows running ‘forever’ (some patterns have static end states of course).
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
WhenInSpace: https://wheninspace.se/en