Conway's Game of Life - online JavaScript version

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.

2 comments:

  1. It works! Would be great to be able to select area size and chose manually initial population, other than that - great.

    Good work!

    ReplyDelete
    Replies
    1. Hi,

      Thanks!

      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.

      Delete