Created
October 29, 2019 17:22
-
-
Save fakedrake/6e09b0d3447c54bdac63c8ebffc896d8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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