add message when ft logo not display

This commit is contained in:
2026-04-03 14:47:34 +02:00
parent 11947db62f
commit 5022cfe020
3 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -4,6 +4,6 @@ ENTRY=1,1
EXIT=5,7 EXIT=5,7
OUTPUT_FILE=con OUTPUT_FILE=con
PERFECT=True PERFECT=True
GENERATOR=DFS GENERATOR=Kruskal
SOLVER=AStar SOLVER=AStar
SEED=168431 SEED=168431
+2
View File
@@ -39,6 +39,8 @@ class AMazeIng(BaseModel):
raise ValueError("Exit coordinates exceed the maze size") raise ValueError("Exit coordinates exceed the maze size")
if self.entry == self.exit: if self.entry == self.exit:
raise ValueError("Entry and Exit coordinates cant be the same") raise ValueError("Entry and Exit coordinates cant be the same")
if self.width <= 10 or self.height <= 10:
print("Height or width to low for disply forty two logo")
return self return self
def generate(self) -> Generator[Maze, None, None]: def generate(self) -> Generator[Maze, None, None]:
+7
View File
@@ -295,6 +295,9 @@ class Kruskal(MazeGenerator):
if height > 10 and width > 10: if height > 10 and width > 10:
cells_ft = self.get_cell_ft(width, height) cells_ft = self.get_cell_ft(width, height)
if cells_ft and (self.start in cells_ft or self.end in cells_ft): if cells_ft and (self.start in cells_ft or self.end in cells_ft):
print(
"Forty two will not be display. Entry or exit set in the ft logo"
)
cells_ft = None cells_ft = None
if seed is not None: if seed is not None:
@@ -383,6 +386,10 @@ class DepthFirstSearch(MazeGenerator):
print(self.end) print(self.end)
print(self.forty_two) print(self.forty_two)
visited = self.lock_cell_ft(visited, self.forty_two) visited = self.lock_cell_ft(visited, self.forty_two)
else:
print(
"Forty two will not be display. Entry or exit set in the ft logo"
)
path: list[tuple[int, int]] = list() path: list[tuple[int, int]] = list()
w_h = (width, height) w_h = (width, height)
coord = (0, 0) coord = (0, 0)