diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-17 20:10:28 +0000 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2021-12-17 20:10:28 +0000 |
commit | f0fe0c242e97908bde78fdeee1549406e2059c04 (patch) | |
tree | 95ff416d63cfc81663477fb70c7fc579f01f4159 | |
parent | 0ef97e71485466e9982734f811a6fde4ebed1fca (diff) | |
download | aoc2021-f0fe0c242e97908bde78fdeee1549406e2059c04.tar.gz aoc2021-f0fe0c242e97908bde78fdeee1549406e2059c04.tar.xz aoc2021-f0fe0c242e97908bde78fdeee1549406e2059c04.zip |
utils: adjacent fix diagonals
-rw-r--r-- | utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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) \ |