One-Dimensional Cellular Automaton in Python