So a few years back I implemented Conway's Game of Life, in JavaScript. To follow along, you can view the jsFiddle here: jsfiddle_net/1v18fog6/ (EDIT: apparently JSFiddle links are blocked?) PM me if you want the GitHub repo
Lately I've been playing with /improving it, mostly as a demonstration of JS/jQuery (Yes, I know JQuery is probably a slow solution for this problem, but I don't really care about speed)
After visiting the wikipedia page for the game (http://en.wikipedia.org/wiki/Conway's_Game_of_Life) I tried to re-create some of the interesting structures they have there, such as oscillators, gliders, and guns.
I cleared the board and re-created them by manually setting a few up, but for some reason I get different results. I have checked my code against the rules stated on the Wikipedia page, and don't seem to have missed anything. Maybe I just need a fresh set of eyes.
the wiki states
My rules are in the DetermineNextCellState function.
Lately I've been playing with /improving it, mostly as a demonstration of JS/jQuery (Yes, I know JQuery is probably a slow solution for this problem, but I don't really care about speed)
After visiting the wikipedia page for the game (http://en.wikipedia.org/wiki/Conway's_Game_of_Life) I tried to re-create some of the interesting structures they have there, such as oscillators, gliders, and guns.
I cleared the board and re-created them by manually setting a few up, but for some reason I get different results. I have checked my code against the rules stated on the Wikipedia page, and don't seem to have missed anything. Maybe I just need a fresh set of eyes.
the wiki states
1. Any live cell with less than two live neighbours dies, as if caused by under-population.
2. Any live cell with two or three live neighbours lives on to the next generation.
3. Any live cell with more than three live neighbours dies, as if by overcrowding.
4. Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.
My rules are in the DetermineNextCellState function.
Last edited: