Simulate a two-dimensional cellular automaton