# Collaborative artificial life

I have always been fascinated with artificial life and so I decided to make my own real-time collaborative cellular automaton in Node.js. More specifically I wanted to bring the magic of real-time collaboration to the Conway’s Game of Life so that every single user that loads the game would be interacting with the same board.

The Game of Life was created by the British mathematician John Horton Conway. He wanted to find a “self-replicating machine”. Conway drastically simplified an earlier automaton by John von Neumann which contained several complex rules. The Conway’s model appeared on the page 120 of the 1970’s issue of the Scientific American and made him instantly famous.

**Most of the cellular automatons follow a few set of simple rules**, here is an example of how these rules:

Let’s say we have a chessboard grid and a bunch of pawns which we will call *living cells* from now on. If there is a *living cell* on the board that grid square is considered to be alive. If its empty then that square is considered to be dead. These two states are can be easily represented on a computer by using the binary system, so that the equivalence ends up being **1 for a living cell** and **0 for a dead cell**.

Now image that you randomly throw 5 living pawns on the 8x8 board and you end up in the following pattern:

This is called the generation 0, to compute the next generation we will follow these 4 rules:

**1.- Any living cell with fewer than two live neighbors dies, as if caused by under-population.**

**2.- Any living cell with two or three live neighbors lives on to the next generation.**

**3.- Any living cell with more than three live neighbors dies, as if by overcrowding.**

**4.- Any dead cell with exactly three living neighbors becomes a living cell, as if by reproduction.**

By applying these simple rules we can calculate the next generation:

And then,

And so on, if you keep iterating you will notice that successive generations will make the pattern move away from where it started. This pattern will eventually perish when it reaches the border of the chessboard.

There are several, many, many structures that create different results. You can try them on a real chessboard, a piece of paper, or you could simply launch my simulator at http://www.adelriosantiago.com:7000.

That’s the beauty of artificial life. **With some really simple rules you end up having an living ecosystem** (or an artificially living ecosystem to be precise).

This is how the automata looks like:

As stated previously, note that **the app is real-time collaborative**, every user is actually seeing and interacting with the same board, I made it this way to see how it evolves with time, I plan to leave running this project running for a looong time…