Created
September 28, 2019 00:55
-
-
Save colinjfw/f1e7f4dd91177098b58689503a67d543 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
def off_board(state, coord) | |
return true 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 false # If it makes it here we are ok. | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment