Last active
November 20, 2018 17:26
-
-
Save alexgolec/b3cbe68396f503d53244c767be8c8070 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
NEIGHBORS_MAP = { | |
1: (6, 8), | |
2: (7, 9), | |
3: (4, 8), | |
4: (3, 9, 0), | |
5: tuple(), # 5 has no neighbors | |
6: (1, 7, 0), | |
7: (2, 6), | |
8: (1, 3), | |
9: (2, 4), | |
0: (4, 6), | |
} | |
def neighbors(position): | |
return NEIGHBORS_MAP[position] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, there is definitely a mistake for the mapping 4