Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function testAroundCell (screen, y, x, obj) {
- if (testCell(screen[y + 1][x], obj), obj) return {y + 1, x};
- if (testCell(screen[y - 1][x], obj), obj) return {y - 1, x};
- if (testCell(screen[y][x + 1], obj), obj) return {y, x + 1};
- if (testCell(screen[y][x - 1], obj), obj) return {y, x - 1};
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement