I\'m doing the Conway\'s game of life. I\'m pretty sure I\'m close to finished, but when I run it, I get Exception in thread \"main\" java.lang.ArrayIndexOutOfBoundsExcep
As I can see, you basically have two choices:
apply finite bounds, that is, for the cells in the first and last columns and rows, you implement an additional check when counting the number of 'living' neighbours.
apply periodic bounds, that is, the cells on the leftmost column and the cells on the rightmost column are considered as neighbours. With the help of modular arithmetic, these cells don't need to be handled separately from others.