]> Untitled Git - axy/ft/a-maze-ing.git/commitdiff
Rotation fix
authorAxy <gilliardmarthey.axel@gmail.com>
Thu, 5 Feb 2026 02:07:22 +0000 (03:07 +0100)
committerAxy <gilliardmarthey.axel@gmail.com>
Thu, 5 Feb 2026 02:07:22 +0000 (03:07 +0100)
__main__.py
amazeing/display.py
amazeing/maze.py

index d19e4a60ff958ee7c470f2fbee93696d0acdaed8..6706030b433631f0cc4d01227c7ac1f39867fd02 100644 (file)
@@ -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():
index 5d4f973239baa3744e152540b3e3d8681d21af7d..835e1a00a0ad35cd88ceb25beec9a982cb897c98 100644 (file)
@@ -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:
index c496e6e40f505a175c74c43c1af922c731ed7501..9175ffba08d993d1a6de8f053d1bbe49474c7dc7 100644 (file)
@@ -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)