i found this program as an exercise in my school textbook and decided i wanted to try it. I am far ahead of the rest of my class(they just started for...next loops today) so my teacher is busy with other things. I have been able to create the board as well as buttons to clear the board, generate 20 random living cells, and move to the next generation. My problem lies in the algorithm i use to check how many neighbors each cell has. when i try to check the cells on the edges, with x=0 and y=0, obviously cell(x-1,y-1) is out of bounds. i get the correct error. how do i change the algorithm so that this is a toroidal array of cells? I would like the board to wrap in both the x and y axes.
my project code is attached.
[ATTACH]4487[/ATTACH]