From f0fe0c242e97908bde78fdeee1549406e2059c04 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 17 Dec 2021 20:10:28 +0000 Subject: utils: adjacent fix diagonals --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) \ -- cgit v1.2.3-54-g00ecf