Skip to content

Instantly share code, notes, and snippets.

@laserbat
Created July 2, 2011 18:27
Show Gist options
  • Save laserbat/1061498 to your computer and use it in GitHub Desktop.
Save laserbat/1061498 to your computer and use it in GitHub Desktop.
def near(x1,y1,x2,y2):
"""Checks if x1,y1 near x2,y2"""
if -1 <= (x1 - x2) <= 1 and -1 <= (y1 - y2) <= 1:
return True
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment