summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-12-17 20:10:28 +0000
committerTomasz Kramkowski <tk@the-tk.com>2021-12-17 20:10:28 +0000
commitf0fe0c242e97908bde78fdeee1549406e2059c04 (patch)
tree95ff416d63cfc81663477fb70c7fc579f01f4159
parent0ef97e71485466e9982734f811a6fde4ebed1fca (diff)
downloadaoc2021-f0fe0c242e97908bde78fdeee1549406e2059c04.tar.gz
aoc2021-f0fe0c242e97908bde78fdeee1549406e2059c04.tar.xz
aoc2021-f0fe0c242e97908bde78fdeee1549406e2059c04.zip
utils: adjacent fix diagonals
-rw-r--r--utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 8b688a6..44fd07a 100644
--- a/utils.py
+++ b/utils.py
@@ -52,7 +52,7 @@ def adjacent(p: Point2D[int], diagonal: bool = True) -> Iterator[Point2D[int]]:
for dx in range(-1, 2):
for dy in range(-1, 2):
if dx == 0 and dy == 0: continue
- if dx != 0 and dy != 0 and not adjacent: continue
+ if dx != 0 and dy != 0 and not diagonal: continue
yield Point2D(p.x + dx, p.y + dy)
def adjacent_bounded(p: Point2D[int], bound: Point2D[int], diagonal: bool = True) \