Re:Conway's Game of Life in HTML 5
by greendestiny on Thursday July 08, 2010 @03:26AM
(#1496740)
Html5, pfft :) Many years ago I wrote a version of the Game of Life where the html to display a step of the game was both html and c code that could be compiled and run - the output being the duel html/c code for the next iteration. It involved the horrendous of abuse of what netscape (this was 1996 or so) would accept as html, and lots of #defines for the c code. This was for the international obfuscated c code competition - I thought it was pretty badass, but it didn't win. When I dug up the code many years later, I don't think I could ever really get another browser to accept the "html" so maybe it was a better idea than implementation.
Re:Conway's Game of Life in HTML 5
by greendestiny on Thursday July 08, 2010 @04:39AM
(#1496838)
Hey I found the code, this first iteration actual reads a file in '.lif' format or a simplified version thereof, and then produces the duel html/c code:
Re:Conway's Game of Life in HTML 5
by greendestiny on Thursday July 08, 2010 @04:43AM
(#1496844)
And the output looks like, the trick is to define TD and TR as incrementors of the row and column counters and '_' and 'O' as statements which set the relevant place in the array. This is all an overshare, I get that, I'm just excited to find the code.
Re:Conway's Game of Life in HTML 5
by andreyf on Thursday July 08, 2010 @02:13AM
(#1496635)
Here's something I've been meaning to ask someone: are there patterns that can "survive" in some degree of random static in a GoL board? As in, are there spaceships which can fly through other patterns on the board (either leaving behind other patterns, or acting as an "eraser")? Note that they don't necessarily have to "survive" in emptiness.
Re:Conway's Game of Life in HTML 5
by powrtoch on Thursday July 08, 2010 @09:52AM
(#1497287)
Plenty of patterns can survive in some degree of static. One of the rules is "Any live cell with two or three live neighbours lives on to the next generation." Therefore, a spaceship cell that normally had two neighbors could run into an extra blip, and there would be no effect.
As far as specific patterns that are just generally resilient, Life patterns tend to be pretty fragile, and I would expect this to be an unavoidable consequence of the game's rules, one that would scale to any complex construction you built.
Also, I'm not going to attempt a proof but it sure seems that for any pattern X, you could construct a (pretty simple) pattern Y than would destroy it.
Re:Conway's Game of Life in HTML 5
by Unseelie on Thursday July 08, 2010 @02:26PM
(#1498279)
Assume a slower moving boat which fires quick boats forward. In that the 'bullets' would interact with the pattern first, you have a possibility of the things destroying everything in the path of the slow boat. Could work, but the boat itself would need to destroy everything in its path.
Re:Conway's Game of Life in HTML 5
by bootload on Thursday July 08, 2010 @07:18AM
(#1497024)
"Bill Gosper discovered the first glider gun
(and, so far, the smallest one found) in 1970,
earning $50 from Conway. The discovery of the
glider gun eventually led to the proof that
Conway's Game of Life could function as a
Turing machine."
Re:Conway's Game of Life in HTML 5
by zacclark on Thursday July 08, 2010 @12:12AM
(#1496469)
Somehow, even after programming my own version of the game of life, I can still sit there watching it evolve. It never ceases to amaze me how such a set of simple rules can cause such interesting behavior.
Re:Conway's Game of Life in HTML 5
by ugh on Thursday July 08, 2010 @12:02AM
(#1496451)
It does work on my iPod touch (iOS 4). I had to touch a bit longer to change cells and I couldn’t touch and drag to change cells but all the rest works just fine.
It’s a bit slow, though. 20 Hz looks rather like 2 Hz.
As far as specific patterns that are just generally resilient, Life patterns tend to be pretty fragile, and I would expect this to be an unavoidable consequence of the game's rules, one that would scale to any complex construction you built.
Also, I'm not going to attempt a proof but it sure seems that for any pattern X, you could construct a (pretty simple) pattern Y than would destroy it.
http://www.ibiblio.org/lifepatterns/
I think the "stargate" pattern is similar to what you're asking.
But its more of a buzzword, lots of people call things html5 even when its not.
{"w":200,"h":200,"cells":"A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/ANMAfDA/A/A/A/AqDgAeBEAfggAeIIAfQAfRAfDgAfQA/AhDgAf4AfRA/ADGA/A/A/A/A/ALMAfDA/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/A/At"}
Always loved the Game of Life. Programmed in Python & OpenGL a while back, but this is just cool. Glad to play with it every once in a while.
It’s a bit slow, though. 20 Hz looks rather like 2 Hz.