1. Any live cell with fewer than two live neighbors dies, as if caused by under-population. 2. Any live cell with two or three live neighbors lives on to the next generation. 3. Any live cell with more than three live neighbors dies, as if by overcrowding. 4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction. 5. No wrap around. Beyond edge is zero. Eight Neighbors.
Determine the Zoo of life at its previous Snapshot. The output must evolve to the given Zoo Snapshot. It is a Zoo since all animals are in their private enclosures and do not interact with any other animals. Animals are stable or cyclic oscillators.
Input: Zoo , an [m,n] array
Output: ZooPre, image of the Zoo at its prior iteration
Zoo ZooPre 0000000000 000000000 0110000100 011000000 0110000100 011001110 0000000100 000000000 0000000000 000000000
Next: Small Island - Prior Snapshot Prediction