finish the thing

This commit is contained in:
Maoake Teriierooiterai
2026-04-03 12:30:42 +02:00
parent 9c76914366
commit b6067b2045
3 changed files with 14 additions and 3 deletions
+11 -2
View File
@@ -2,7 +2,16 @@ WIDTH=10
HEIGHT=10 HEIGHT=10
ENTRY=1,1 ENTRY=1,1
EXIT=10,10 EXIT=10,10
OUTPUT_FILE=maze.txt OUTPUT_FILE=con
PERFECT=True PERFECT=True
GENERATOR=Kruskal GENERATOR=DFS
SOLVER=AStar SOLVER=AStar
salut
#
#
#
#
#
#
#
##
+2
View File
@@ -36,6 +36,8 @@ class AMazeIng(BaseModel):
raise ValueError("Entry coordinates exceed the maze size") raise ValueError("Entry coordinates exceed the maze size")
if self.exit[0] > self.width or self.exit[1] > self.height: if self.exit[0] > self.width or self.exit[1] > self.height:
raise ValueError("Exit coordinates exceed the maze size") raise ValueError("Exit coordinates exceed the maze size")
if self.entry == self.exit:
raise ValueError("Entry and Exit coordinates cant be the same")
return self return self
def generate(self) -> Generator[Maze, None, None]: def generate(self) -> Generator[Maze, None, None]:
+1 -1
View File
@@ -371,7 +371,7 @@ class DepthFirstSearch(MazeGenerator):
if seed is not None: if seed is not None:
np.random.seed(seed) np.random.seed(seed)
maze = self.init_maze(width, height) maze = self.init_maze(width, height)
if width > 9 and height > 9: if width > 10 and height > 10:
self.forty_two = self.get_cell_ft(width, height) self.forty_two = self.get_cell_ft(width, height)
visited: NDArray[np.object_] = np.zeros((height, width), dtype=bool) visited: NDArray[np.object_] = np.zeros((height, width), dtype=bool)
if ( if (