Skip to content

Instantly share code, notes, and snippets.

@colinjfw
Created February 24, 2019 02:18
Show Gist options
  • Save colinjfw/d9b2320f3a87a0d5b66ec8d0be28ac5d to your computer and use it in GitHub Desktop.
Save colinjfw/d9b2320f3a87a0d5b66ec8d0be28ac5d to your computer and use it in GitHub Desktop.
function offBoard(state, coord) {
if (coord.x < 0) return true;
if (coord.y < 0) return true;
if (coord.y >= state.board.height) return true;
if (coord.x >= state.board.height) return true;
return false; // If it makes it here we are ok.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment