Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function testAroundCell (screen, y, x, obj) {
  2.     if (testCell(screen[y + 1][x], obj), obj) return {y + 1, x};
  3.     if (testCell(screen[y - 1][x], obj), obj) return {y - 1, x};
  4.     if (testCell(screen[y][x + 1], obj), obj) return {y, x + 1};
  5.     if (testCell(screen[y][x - 1], obj), obj) return {y, x - 1};
  6.     return false;
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement