I have encountered this problem and i couldn’t find the solution. There is a 2D array with only zeros and ones in it (the size of the array doesnt really matter, i worked with 10×10). Zero means dead and 1 is alive. I double for looped this to check the elements sorroundings and when it sorrounded with other “cells” the