I'm trying to do a Game of Life simulator in python.
There is a 2d array, and needs to make conditional statements based upon the values of the neighbours to each element.
Ex: grid[y][x + 1], grid[y - 1][x], etc.
How exactly to refer to the other end of each grid axis in the case that +1 or -1 takes it out of range?
Is there any way of wrapping around to refer to the opposite end of the x and y axes of the array?