from amazeing import *
import random
-maze = Maze(10, 30)
+maze = Maze(50, 20)
maze.outline()
empty = list(maze.walls_empty())
random.shuffle(empty)
if maze.wall_maintains_topology(wall):
maze.fill_wall(wall)
-backend = TTYBackend(10, 30)
+backend = TTYBackend(50, 20)
backend.set_style("#")
for wall in maze.walls_full():
for pixel in wall.pixel_coords():
self.height: int = maze_height * 2 + 1
self.style: str = style
self.lines: list[list[str]] = [
- [style for _ in range(0, self.height)] for _ in range(0, self.width)
+ [style for _ in range(0, self.width)] for _ in range(0, self.height)
]
def draw_pixel(self, pos: PixelCoord) -> None:
def pixel_coords(self) -> Iterable[PixelCoord]:
a: Iterable[int] = [self.a * 2]
b: Iterable[int] = [self.b * 2, self.b * 2 + 1, self.b * 2 + 2]
- x_iter: Iterable[int] = a if self.orientation == Orientation.HORIZONTAL else b
- y_iter: Iterable[int] = a if self.orientation == Orientation.VERTICAL else b
+ x_iter: Iterable[int] = a if self.orientation == Orientation.VERTICAL else b
+ y_iter: Iterable[int] = a if self.orientation == Orientation.HORIZONTAL else b
return (PixelCoord(x, y) for x in x_iter for y in y_iter)