From 7599c27d51e86ecc2be07260ce98759f4d0a1d66 Mon Sep 17 00:00:00 2001 From: Stefan Harmuth Date: Fri, 23 Dec 2022 17:18:26 +0100 Subject: [PATCH] day22 - restart --- day22_restart.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/day22_restart.py b/day22_restart.py index 5d5b7ec..f2f6f51 100644 --- a/day22_restart.py +++ b/day22_restart.py @@ -50,10 +50,11 @@ def walk(board: Grid, pos: Coordinate, directions: list, face: int = 0) -> (Coor return pos, face -def fold(board: Grid): +def fold(board: Grid, start_pos: Coordinate): # find sides and remember the one with the starting_position as it's the initial x, y plane c_size = 4 if board.maxX < 50 else 50 # account for test case dim_x, dim_y = ((board.maxX + 1) // c_size, (board.maxY + 1) // c_size) + # is there something in the front to fold back? # is there something on the 4 sides to fold in? # is there something on the 4 sides to fold up? @@ -93,7 +94,7 @@ class Day(AOCDay): def part2(self) -> Any: board, directions, start_position = self.get_map_and_directions() - fold(board) + fold(board, start_position) #board.print(translate={None: ' ', False: '#', True: '.'}) return 5031