Game of life
Posted: March 5, 2013 Filed under: Fun | Tags: Cellular automata, iteration, Macro, Visual Basic Leave a commentOnce again cellular automata. This time implementation of famous one – Game of Life.
What is that thingy?
One remarkable example of how simple principles can lead to great complexity. Rules are easy:
- Black (or “living”) cells are black, white cells hold 0 or no value.
- Cell become white if number of black neighbors is below 2 or above 3
- Cell becomes black if number of black neighbors equals 3
- Cell maintains it’s color if number of black neighbors equals 2
With this set great deal of possible configurations and forms can be achieved. Oscillators, puffers, gliders, space ships – those are classes of some specific configurations that can be found in Game of Life world.
In my implementation we have two tables – one is our visualized “world” and the other is needed for calculation of the next step. As always top is connected with bottom and left with right. Ctrl + j evaluate one step further.
Why?
IT IS SOOO SIMPLE! I couldn’t resist.