Skip to content

Instantly share code, notes, and snippets.

@fakedrake
Created October 29, 2019 17:22
Show Gist options
  • Save fakedrake/6e09b0d3447c54bdac63c8ebffc896d8 to your computer and use it in GitHub Desktop.
Save fakedrake/6e09b0d3447c54bdac63c8ebffc896d8 to your computer and use it in GitHub Desktop.
def in_grid(cur,grid):
x,y = cur
height = len(grid)
if y >= height or y < 0:
return False
row = grid[y]
width = len(row)
if x >= len(row) or x < 0:
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment