all 2 comments

[–]C3P0 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

Then the next step up from this would be making each node an instance of the class Node. Node has properties: position and neighbors. There are eight neighbors.

This way, you wouldn't have to exclude yourself in every check (i==0 && j==0).

[–]flush_the_turd[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (0 children)

I'll give that a try.