From 0fb700974fbb4509fb60f8970330653ff176f4f7 Mon Sep 17 00:00:00 2001 From: Lucas Flores Date: Tue, 10 Feb 2026 15:41:18 +0100 Subject: [PATCH] je sais plus ce que j'ai fait --- __main__.py | 2 +- amazeing/maze_class/__init__.py | 18 +++++++++--------- amazeing/maze_class/maze.py | 4 ++-- amazeing/maze_class/maze_walls.py | 30 +++++++++++++++--------------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/__main__.py b/__main__.py index 7c239cc..2d8406b 100644 --- a/__main__.py +++ b/__main__.py @@ -9,7 +9,7 @@ from time import sleep # random.seed(42) -dims = (10, 10) +dims = (50, 15) maze = Maze(dims) diff --git a/amazeing/maze_class/__init__.py b/amazeing/maze_class/__init__.py index 210ff0e..b9dcb9b 100644 --- a/amazeing/maze_class/__init__.py +++ b/amazeing/maze_class/__init__.py @@ -1,13 +1,13 @@ +__author__ = "agilliar & luflores" + from .maze import Maze from .maze_pattern import Pattern from .maze_walls import (MazeWall, NetworkID, Orientation, - WallCoord, WallNetwork) + WallCoord) -all = [ - Maze, - Pattern, - MazeWall, - NetworkID, - Orientation, - WallCoord, - WallNetwork] +__all__ = ["Maze", + "Pattern", + "MazeWall", + "NetworkID", + "Orientation", + "WallCoord",] diff --git a/amazeing/maze_class/maze.py b/amazeing/maze_class/maze.py index e94ff02..bb41fde 100644 --- a/amazeing/maze_class/maze.py +++ b/amazeing/maze_class/maze.py @@ -1,6 +1,6 @@ from typing import Callable, Generator, Iterable, cast -from .maze_walls import (MazeWall, NetworkID, - Orientation, WallCoord, WallNetwork) +from .maze_walls import (MazeWall, NetworkID, WallNetwork, + Orientation, WallCoord) class Maze: diff --git a/amazeing/maze_class/maze_walls.py b/amazeing/maze_class/maze_walls.py index d4f0faf..ad000f0 100644 --- a/amazeing/maze_class/maze_walls.py +++ b/amazeing/maze_class/maze_walls.py @@ -1,6 +1,5 @@ from enum import Enum, auto from typing import Iterable, Optional, cast - from ..maze_display import PixelCoord @@ -12,6 +11,21 @@ class NetworkID: NetworkID.__uuid_gen += 1 +class WallNetwork: + def __init__(self) -> None: + from .maze_walls import WallCoord + self.walls: set[WallCoord] = set() + + def size(self) -> int: + return len(self.walls) + + def add_wall(self, id: "WallCoord") -> None: + self.walls.add(id) + + def remove_wall(self, id: "WallCoord") -> None: + self.walls.remove(id) + + class MazeWall: def __init__(self, network_id: Optional[NetworkID] = None) -> None: self.network_id: Optional[NetworkID] = network_id @@ -126,17 +140,3 @@ class CellCoord: def y(self) -> int: return self.__y - - -class WallNetwork: - def __init__(self) -> None: - self.walls: set[WallCoord] = set() - - def size(self) -> int: - return len(self.walls) - - def add_wall(self, id: WallCoord) -> None: - self.walls.add(id) - - def remove_wall(self, id: WallCoord) -> None: - self.walls.remove(id) -- 2.52.0