mirror of
https://github.com/maoakeEnterprise/amazing.git
synced 2026-04-28 16:04:35 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6067b2045 | |||
| 9c76914366 | |||
| b38da3fc31 |
@@ -13,10 +13,10 @@ run_windows:
|
|||||||
.venv\Scripts\python -m a_maze_ing config.txt
|
.venv\Scripts\python -m a_maze_ing config.txt
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
uv pdb python3 a_maze_ing.py config.txt
|
uv run python3 -m pdb a_maze_ing.py config.txt
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf */**/__pycache__ */__pycache__ __pycache__ .mypy_cache .venv dist build */**/*.egg-info */*.egg-info *.egg-info test.txt
|
rm -rf */**/__pycache__ */__pycache__ __pycache__ */.mypy_cache .mypy_cache .venv dist build */**/*.egg-info */*.egg-info *.egg-info test.txt
|
||||||
|
|
||||||
fclean: clean
|
fclean: clean
|
||||||
rm mazegen-1.0.0-py3-none-any.whl
|
rm mazegen-1.0.0-py3-none-any.whl
|
||||||
|
|||||||
+1
-1
@@ -474,7 +474,7 @@ class MazeMLX:
|
|||||||
self.mlx.mlx_loop_hook(self.mlx_ptr, self.draw_image, amazing)
|
self.mlx.mlx_loop_hook(self.mlx_ptr, self.draw_image, amazing)
|
||||||
self.mlx.mlx_hook(self.win_ptr, 33, 0, self.close_loop, None)
|
self.mlx.mlx_hook(self.win_ptr, 33, 0, self.close_loop, None)
|
||||||
self.mlx.mlx_hook(
|
self.mlx.mlx_hook(
|
||||||
self.win_ptr, 2, 1 << 0, self.handle_key_press_mteriier, amazing
|
self.win_ptr, 2, 1 << 0, self.handle_key_press, amazing
|
||||||
)
|
)
|
||||||
self.mlx.mlx_loop(self.mlx_ptr)
|
self.mlx.mlx_loop(self.mlx_ptr)
|
||||||
|
|
||||||
|
|||||||
+11
-2
@@ -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
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
##
|
||||||
|
|||||||
@@ -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]:
|
||||||
|
|||||||
@@ -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 (
|
||||||
|
|||||||
Reference in New Issue
Block a user