]> Untitled Git - axy/ft/a-maze-ing.git/commitdiff
Rename method and fix master
authorAxy <gilliardmarthey.axel@gmail.com>
Thu, 5 Feb 2026 02:29:21 +0000 (03:29 +0100)
committerAxy <gilliardmarthey.axel@gmail.com>
Thu, 5 Feb 2026 02:29:21 +0000 (03:29 +0100)
__main__.py
amazeing/maze.py

index 6706030b433631f0cc4d01227c7ac1f39867fd02..8e366f8ea2d5e2c789edf735960e57b95d151615 100644 (file)
@@ -6,7 +6,7 @@ maze.outline()
 empty = list(maze.walls_empty())
 random.shuffle(empty)
 for wall in empty:
 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)
         maze.fill_wall(wall)
 
 backend = TTYBackend(50, 20)
index 9175ffba08d993d1a6de8f053d1bbe49474c7dc7..ccfd439e6bbce45ee682b15653035044616aac3d 100644 (file)
@@ -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 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())
         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()
         }
             for neighbour in self.get_walls_checked(wall.b_neighbours())
             if neighbour.is_full()
         }
-        return len(a & b) == 0
+        return len(a & b) != 0