Cellular automaton - implementation in C