From 4163aa2bddb2f81eeb677142bec87463de0aab69 Mon Sep 17 00:00:00 2001 From: Axy Date: Thu, 5 Feb 2026 03:07:22 +0100 Subject: [PATCH] Rotation fix --- __main__.py | 4 ++-- amazeing/display.py | 2 +- amazeing/maze.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/__main__.py b/__main__.py index d19e4a6..6706030 100644 --- a/__main__.py +++ b/__main__.py @@ -1,7 +1,7 @@ from amazeing import * import random -maze = Maze(10, 30) +maze = Maze(50, 20) maze.outline() empty = list(maze.walls_empty()) random.shuffle(empty) @@ -9,7 +9,7 @@ for wall in 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(): diff --git a/amazeing/display.py b/amazeing/display.py index 5d4f973..835e1a0 100644 --- a/amazeing/display.py +++ b/amazeing/display.py @@ -22,7 +22,7 @@ class TTYBackend(Backend): 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: diff --git a/amazeing/maze.py b/amazeing/maze.py index c496e6e..9175ffb 100644 --- a/amazeing/maze.py +++ b/amazeing/maze.py @@ -56,8 +56,8 @@ class WallID: 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) -- 2.52.0