Merge branch 'main' of github.com:maoakeEnterprise/amazing into mlx

This commit is contained in:
2026-03-27 18:29:39 +01:00
4 changed files with 6 additions and 19 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ class AMazeIng(BaseModel):
return
def solve_path(self) -> str:
return self.solver.solve(self.maze)
return self.solver.solve(self.maze, self.height, self.width)
def __str__(self) -> str:
res = self.maze.__str__()
+3 -3
View File
@@ -152,7 +152,8 @@ class AStar(MazeSolver):
str(list(c[1].keys())[0]) for c in path if len(c[1]) > 0
)
def solve(self, maze: Maze) -> str:
def solve(self, maze: Maze, height: int = None,
width: int = None) -> str:
res = self.get_path(maze.get_maze())
if res is None:
raise Exception("Path not found")
@@ -161,8 +162,7 @@ class AStar(MazeSolver):
class DepthFirstSearchSolver(MazeSolver):
def __init__(self, start, end):
self.start = (start[1] - 1, start[0] - 1)
self.end = (end[1] - 1, end[0] - 1)
super().__init__(start, end)
def solve(self, maze: Maze, height: int = None,
width: int = None) -> str:
+2 -1
View File
@@ -1,5 +1,5 @@
from src.amaz_lib.MazeGenerator import DepthFirstSearch, Kruskal
from src.amaz_lib.MazeSolver import AStar
from src.amaz_lib.MazeSolver import AStar, DepthFirstSearchSolver
class DataMaze:
@@ -68,6 +68,7 @@ class DataMaze:
}
available_solver = {
"AStar": AStar,
"DFS": DepthFirstSearchSolver
}
res = {}
res["GENERATOR"] = available_generator[data["GENERATOR"]](entry, exit,
-14
View File
@@ -1,14 +0,0 @@
B953BD3917
C478416EC3
957ABEBD3A
817AC16D42
E87C107BD2
B8552A9456
82BBAEC157
EEAA855417
B96C2D3903
C45547C6EE
1,1
9,9
SENEESSSSESSSEEEES