mirror of
https://github.com/Fare-spec/cours.git
synced 2025-12-09 11:30:38 +00:00
Auto urgent commit.
This commit is contained in:
22
graphes/maze/maze_creator.py
Normal file
22
graphes/maze/maze_creator.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import fifo
|
||||
import lifo
|
||||
|
||||
class Labyrinth:
|
||||
def __init__(self, rows, cols) -> None:
|
||||
self.rows = rows
|
||||
self.cols = cols
|
||||
self.grid = [[1 for _ in range(cols)]for _ in range(rows)]
|
||||
self.visited = [[False for _ in range(cols)]for _ in range(rows)]
|
||||
self.stack = fifo.Pile()
|
||||
self.queue = lifo.Queue()
|
||||
self.start = None
|
||||
self.end = None
|
||||
|
||||
def __str__(self) -> str:
|
||||
return "\n".join("".join(" " if cell == 0 else "#" for cell in row) for row in self.grid)
|
||||
def set_start_end(self, start, end):
|
||||
self.start = start
|
||||
self.end = end
|
||||
def generate_maze(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user