I am making game of life in 2D array. I need to determine when all adjacent cells are empty so I just test all of them. It works well unless the cell being checked is the boundary. Then of course testing X+1 throws an exception as the index is out of the array boundaries. Can I handle this somehow instead of handling the exception?
Thanks
I am making game of life in 2D array. I need to determine when
Share
If you want speed you’ll have to treat the edge-cells differently and process the rest with a