diff --git a/config.txt b/config.txt index b15d95f..febdc6b 100644 --- a/config.txt +++ b/config.txt @@ -1,7 +1,7 @@ -WIDTH=100 -HEIGHT=100 +WIDTH=15 +HEIGHT=15 ENTRY=1,1 -EXIT=5,7 +EXIT=15,10 OUTPUT_FILE=con PERFECT=True GENERATOR=Kruskal diff --git a/mazegen-1.0.0-py3-none-any.whl b/mazegen-1.0.0-py3-none-any.whl new file mode 100644 index 0000000..56cf876 Binary files /dev/null and b/mazegen-1.0.0-py3-none-any.whl differ diff --git a/src/mazegen/MazeSolver.py b/src/mazegen/MazeSolver.py index bba0a6e..b2d9bce 100644 --- a/src/mazegen/MazeSolver.py +++ b/src/mazegen/MazeSolver.py @@ -84,7 +84,8 @@ class AStar(MazeSolver): start: Start coordinates using 1-based indexing. end: End coordinates using 1-based indexing. """ - super().__init__(start, end) + self.start = (start[0] - 1, start[1] - 1) + self.end = (end[0] - 1, end[1] - 1) def h(self, n: tuple[int, int]) -> int: """Compute the Manhattan distance heuristic to the goal. @@ -196,6 +197,8 @@ class AStar(MazeSolver): to_check, ) ) + if path == self.end: + break raise Exception("Path not found") def get_rev_dir(self, current: Node) -> str: