Game of life is an example of a system with very simple rules but unpredictable state in the long term.
Each square represents a living space available for a single cell. If there aren't enough cells in the neighborhood, the space is empty, if the cell was present there it dies from loneliness. If in the neighborhood is enough of other cells, the cell can survive in its square, or a new cell is born if it was empty before.
It's interesting to notice that we can't compute the n-th iteration directly, we have to go through all previous iterations.
Controls: generate new map / start / pause-unpause.
I wrote this implementation almost ten years ago, so it may not be how it should be done today, especially the table should be replaced by canvas, but it's still usable and shows the concept.
If you are interested, how it works, please take a look on the source code of this page.
It works! Would be great to be able to select area size and chose manually initial population, other than that - great.
ReplyDeleteGood work!
Hi,
DeleteThanks!
That's a good idea, but I don't plan to develop this further, at least at this moment :-)
It's a really old script.