How would one go about checking the spaces around the space clicked? The index numbers start at 0 top left and end at 8 bottom right.
0 1 2
3 4 5
6 7 8

If that matters. Would I just kinda check the index number and then work it out from there or would there be an easier way to do it so that it could just be a general checking procedure that they could all use? Because it would probably be easier to check both of the spaces instead of just one at a time. Thanks for the help.