Skip to content

Instantly share code, notes, and snippets.

@colinjfw
Created September 28, 2019 00:55
Show Gist options
  • Save colinjfw/f1e7f4dd91177098b58689503a67d543 to your computer and use it in GitHub Desktop.
Save colinjfw/f1e7f4dd91177098b58689503a67d543 to your computer and use it in GitHub Desktop.
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