Created
February 24, 2019 02:18
-
-
Save colinjfw/d9b2320f3a87a0d5b66ec8d0be28ac5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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