Created
July 2, 2011 18:27
-
-
Save laserbat/1061498 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 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