Skip to content

Instantly share code, notes, and snippets.

@oscarryz
Created September 11, 2012 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscarryz/3700589 to your computer and use it in GitHub Desktop.
Save oscarryz/3700589 to your computer and use it in GitHub Desktop.
if (x == 0 && y == length) {return setNeighboursValues(length , x , x + 1, y - 1 , y , 0 ); }
if (x == 0 && y > 0 && y < length) {return setNeighboursValues(length , x , x + 1, y - 1 , y , y + 1 ); }
if (x == 0 && y == 0) {return setNeighboursValues(length , x , x + 1, length , y , y + 1 ); }
if (x > 0 && x < length && y == 0) {return setNeighboursValues(x - 1 , x , x + 1, length , y , y + 1 ); }
if (x > 0 && x < length && y == length){return setNeighboursValues(x - 1 , x , x + 1, y - 1 , y , 0 ); }
return setNeighboursValues(x - 1 , x , x + 1, y - 1 , y , y + 1 );
if (x == length && y == 0) {return setNeighboursValues(x - 1 , x , 0 , length , y , y + 1 ); }
if (x == length && y > 0 && y < length) {return setNeighboursValues(X - 1 , x , 0 , y - 1 , y , y + 1 ); }
if (x == length && y == length) {return setNeighboursValues(x - 1 , x , 0 , y - 1 , y , 0 ); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment