From bbb0fefe677156f7b7a06515f4669ee5492cb6c5 Mon Sep 17 00:00:00 2001 From: Axy Date: Thu, 5 Feb 2026 03:29:21 +0100 Subject: [PATCH] Rename method and fix --- __main__.py | 2 +- amazeing/maze.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/__main__.py b/__main__.py index 6706030..8e366f8 100644 --- a/__main__.py +++ b/__main__.py @@ -6,7 +6,7 @@ maze.outline() empty = list(maze.walls_empty()) random.shuffle(empty) for wall in empty: - if maze.wall_maintains_topology(wall): + if not maze.wall_bisects(wall): maze.fill_wall(wall) backend = TTYBackend(50, 20) diff --git a/amazeing/maze.py b/amazeing/maze.py index 9175ffb..ccfd439 100644 --- a/amazeing/maze.py +++ b/amazeing/maze.py @@ -170,7 +170,7 @@ class Maze: def walls_empty(self) -> Iterable[WallID]: return filter(lambda w: not self._get_wall(w).is_full(), self.all_walls()) - def wall_maintains_topology(self, wall: WallID) -> bool: + def wall_bisects(self, wall: WallID) -> bool: a = { cast(NetworkID, neighbour.network_id) for neighbour in self.get_walls_checked(wall.a_neighbours()) @@ -181,4 +181,4 @@ class Maze: for neighbour in self.get_walls_checked(wall.b_neighbours()) if neighbour.is_full() } - return len(a & b) == 0 + return len(a & b) != 0 -- 2.52.0