From f17b7f75d2b996f7ff5b373abe5616de0ecfe1d9 Mon Sep 17 00:00:00 2001 From: Clement Date: Mon, 16 Dec 2024 19:14:02 +0800 Subject: [PATCH] Day 16 Part 1 Non working --- 2024/day-16/input | 141 +++++++++++++++++++++++++++ 2024/day-16/solution-1.sh | 196 ++++++++++++++++++++++++++++++++++++++ 2024/day-16/test-input-1 | 15 +++ 3 files changed, 352 insertions(+) create mode 100644 2024/day-16/input create mode 100644 2024/day-16/solution-1.sh create mode 100644 2024/day-16/test-input-1 diff --git a/2024/day-16/input b/2024/day-16/input new file mode 100644 index 0000000..e19c18d --- /dev/null +++ b/2024/day-16/input @@ -0,0 +1,141 @@ +############################################################################################################################################# +#.....#.........#.......#.....................#.....#...#.........#.#.....#.......#.........#.........#.......#...#.........#...#.....#...#E# +#.#.#.#.#####.###.#.#####.###.#.#.#.#.#######.#.###.#.#.###.#.###.#.#.#.###.###.#.###.#.###.#.#######.###.###.#.#.#.#.#####.#.#.#.#.#.#.#.#.# +#.#.#.#.....#...#.#.#.......#.#.#.#.#.#.....#...#.#...#...#.................#...#.....#.#...#.#.....#...#...#.#.#...#.#.....#.#...#.#...#...# +#.#.#######.###.#.#.#.#######.#.#.#.#.#.###.#.###.#######.###.#.#.###########.#######.#.#.###.#.#######.###.#.#######.#.#####.#####.#######.# +#.#.#.....#...#...#.......#...#...#...#...#.......#.....#.....#.#.....#.......#.......#.#.#...#.......#.....#.#.......#...#.#.#...#.....#...# +###.#.#.#####.#############.###############.#.###.#.###.#######.###.#.#.###########.###.#.###.#####.#########.#.#########.#.#.#.#.#.###.#.#.# +#...#.#...........................#...#...#...................#.....#.#...........#.....#.#...#.....#.......#...#.....#...#...#.#.#...#...#.# +#.#.#.###.#.#.#.#####.#.#####.###.#.#.#.#.#.#.#####.#####.#.#.#.###.#.#########.#.#.#####.#.###.#####.#.#########.#####.#######.#.#########.# +#...................#.#.#...#.#...#.#...#...#.....#.....#.#.#...#.#...#.......#.#.#.....#...#...#...#.#.....................................# +#.###.#.#.###.###.#.#.###.#.#.#.###.###.#####.###.#.###.###.###.#.#####.#####.###.#.###.#####.###.#.#.###############.#######.#.###########.# +#.#...#.#.....#...#...#...#...#...#.......................#.......#.....#...#...............#.....#...#.....#.....#.#.................#.....# +#.#.#.#.###.###.#####.#.#########.#.#.###.###.#.#.#######.#####.#.#####.###.#.#.#.###.#####.#.###########.#.###.#.#.#######.#.#.#.#####.###.# +#...#.#.......#.....#.#.#.....#...#.#.....#.....#...........#...#.......#...#.#.#.#...#.......#.....#...#.#.....#.......#...#...#.....#.....# +#.###.#.#.#.#.#####.###.###.###.#####.#####.#.#############.#.#.#########.###.#.###.###.#####.#.###.#.#.#.#####.#########.#######.###.#####.# +#.#.....#.#...#...#...#...#.#...#...#.....#.........#.......#.....#...#.....#.#.....#...#.....#...#...#...#.#...#.........#.........#.#.....# +#.#.#.###.#.###.#.###.###.#.#.#.#.#.#####.#########.#.#######.###.#.#.###.#.#.#.#####.###.#######.#########.#.###.#########.#########.#.###.# +#.#.......#.....#.#.....#.....#.#.#.#.........#.....#.........#.#...#...#.#.#.#...#...#...#.......#.......#.....#.........#.#...#.....#.....# +#.#.#.#####.#######.###.###.#.#.#.#.###.#######.###############.#######.###.#.#####.###.###.###.###.###.#.#.#############.#.###.#.###.#.###.# +#.#.#.......#.......#.#.#.#.#.#.#.#...#.#.......#...............#.....#.....#.#.....#...#...#...#.....#.#.#.#...........#.#...........#...#.# +#.#.#.#####.#.#######.#.#.#.#.###.###.###.#######.#######.#.#####.###.#.#####.#.#####.###.###.###.###.#.###.#.#########.#.###.#.#.#.###.#.#.# +#...#.#.....#.....#.......#.#.......#.#...#.......#.......#.#.......#...#.....#...#...#...#...#.#...#.#...#.#.....#.#...#.#...#.............# +###.#.#.###.#####.#.#######.#########.#.#.#.#######.###.#.###.###########.#######.#.#######.###.###.#.###.#.#####.#.#.###.#.###.#.#.#.#.##### +#.............#...#.#.......#...#.#...#...#...#...#.#.#.#.....#.#.........#...#...#.#.....#.#.......#...#...#.....#.#.....#.#...#.#...#.#...# +###.#.#.###.#.#.#.#.#.#######.#.#.#.#####.#####.#.#.#.#.###.###.#.#########.#.#.#.#.#.###.#.#.#########.#####.#####.#.###.#.#.#.#.#####.#.#.# +#...#.....#.#.#.#...#.......#.....#.....#.......#.....#...#.....#.#.........#...#.#...#.#...#...#.............#.....#.#...#.#.#.#.......#.#.# +#.#.#.###.#.#.#.###########.#.#.#.#####.#.###########.###.#####.#.###.#.#########.#####.#######.#.#######.#.#######.#.#.#.#.#.###.#####.#.#.# +#.#.#...#.#...#.#...#...#...#.#...#.....#.#.....#...#...#...#...#.#...#.#...........#.......#.....#.....#.#...#...#.#.#.#...#.............#.# +#.#.#.#.#.#####.#.#.#.#.#.###.#####.#####.#.###.#.#.#######.#####.#.###.#.#######.#.#.###.###.#####.###.#####.#.#.#.#.#.#.#####.###########.# +#.#.#.#.#.......#.#...#...#.....#...#.#...#.#.#...#.......#.#.....#...#.#.#.#.....#...#.#.#.....#...#.#...#...#.#...#...#.......#.........#.# +#.#.###.#######.#.###.#########.#.###.#.###.#.###########.#.#.#######.#.#.#.#.#####.###.#.#.#####.###.###.#.###.#######.#.#######.#########.# +#.#.....#.......#...#...........#.#...#...#.#...#.......#.#.#...#...........#.#.......#...#.#.#...#.#...#...#.#...........#.........#.......# +#.#.###############.#.#########.#.###.###.#.#.###.#.#####.#.###.#.#.#######.#.###.#.###.###.#.#.###.#.#.#####.#.###########.#######.#.####### +#...#.............#...#.....#...#...#.#...#.#.....#.....#.#.#...#.#.......#.#...#.#...#.#.#.....#.....#.........#.....#...#.#.....#.#...#...# +###.#.#########.#.#####.#.###.#####.#.#.###.###.#######.#.#.#.###.###.###.###.#.#####.#.#.###.#.#.#######.#######.###.#.#.#.#####.#.###.#.#.# +#...#.#.....#...#...#...#.#...#.#...#...#.#...#.#.....#.....#.....#...#.#...#.#.#.....#...#.#.#.#.#.....#.#.....#...#...#...#...#.#...#...#.# +#.#.#.#.#####.#####.#.#####.###.#.###.###.###.###.###.#############.###.###.###.#.#######.#.#.#.###.###.###.###.###.#########.#.#.###.#####.# +#.#...#.....#...#.....#.....#...#.#.#.#.....#...#.#.#.......#.......#.......#...#.......#...#.#.......#.#...#.#.....#.........#.#...#.....#.# +#.#.###.###.###.#####.#.#.#####.#.#.#.#.#######.#.#.#######.#.#.#####.#######.###.###.#####.#.#########.#.###.#######.###.#####.#.#.###.#.#.# +#.#...#...#...#.....#.#.#...#.......#.#.......#.#.#.......#...#.#...#...#.....#.....#.#.....#.....#.....#.#.....#.......#...#...#.#...#.#.#.# +#.###.###.#.#.#####.#.#.#.#.#.#.#.#.#.###.#.#.#.#.#.#.###.#####.###.###.#.###.#####.#.#.#########.#.#.###.#.#.#.#.#####.###.#.###.###.#.#.#.# +#...#...#.#.....#.#.#.#...#...#...#.#...#.#.#.#.#.#.#.#...#...#...#...#...#...#...#.#.#.....#.#...#.#.#...#...#...#.....#...#.#...#.#.#.#...# +###.###.#.###.#.#.#.#.#####.###.###.###.#.#.#.#.#.###.#.#####.###.#.#.#####.#.#.#.###.#####.#.#.###.###.###.#.#####.#.###.###.###.#.#.#.###.# +#...#.....#.#.#...#.#.#.....#...#...#...#.#.#.#...#...#.#.......#.#.#.........#.#...#.........#...#...#...#.#...#...#.....#.#...#.#.#.#.#...# +#.#.#.###.#.#.###.#.###.#####.###.#.#.#####.#.#####.###.#.###.###.#############.###.#.###.###.###.###.###.#####.###.#######.#.#.#.#.#.#.#.### +#.#.#.#.#...#...#.#.........#.#...#.#.#.............#.....#.#.#.............#...#.#.#...#...#...#...#...#...#...#.....#.....#.#.#.#.#.#...#.# +#.#.#.#.###.###.#.#########.#.#.###.#.#.###.#######.#######.#.#.###.#######.#.###.#.#####.#.#######.#.#####.#.###.#.###.#.#.#.#.#.#.#.#####.# +#.#.#.#.......#.#.....#...#.#.#.#...#...#...#...#...#.....#...#.#...#.....#...#...#.....#.#...#.....#.......#...#.#.#...#.#...#.#.#.#.......# +#.###.#.#######.#######.#.#.#.#.###.#####.###.#.#.###.#.#.#####.#.#####.#########.#####.#.###.#.###############.#.#.#.###.###.#.#.#.###.##### +#.....#...#.....#.......#.#.#.#...#.#.....#...#...#...#.#.#.....#.....#...........#...#...#.#...#.#.....#.......#.....#.#.#...#.#.....#.....# +###########.#####.###.#.#.###.###.#.###.#.#.#######.###.#.#.###.#####.#######.###.###.#####.#####.#.#.###.#.#####.#####.#.#.###.###########.# +#.#.........#...#.#...#.#.....#...#.#...#.#.#...#...#...#...#.#.....#.......#...#.............#.....#.....#.#...#.......#.#...#.....#...#...# +#.#.###.#####.#.#.#.###.###.###.###.#.###.#.#.###.###.#######.#.#.#########.#.#.#####.#######.###.#########.#.###.#####.#.###.#####.#.#.#.#.# +#.............#...#.....#...#...#.....#...#...#...#.............#.....#.....#.#.#.....#.....#...#.#.....#...#...#.......#.#.......#.#.#...#.# +#.###.#.#.#.#.###########.#.#.#.#############.#.###.#########.###.#.###.#######.#.#####.###.###.#.###.#.#.#####.#######.#.#.###.###.#.#####.# +#...#.#...#.#.......#.....#.#.#...........#...#.#...#.#.....#.....#...#.........#...#...#.#.....#...#.#.#.#...#.........#.#.#.........#...#.# +#.#.#.#####.#######.#.#####.#.###########.#.###.#.###.#.###.#.#######.#######.#.#.#.#.###.#########.#.#.#.#.#.#.#########.#.#.#.#.#####.#.#.# +#.#.#.#...#.............#...#.........#...#...#.#.....#.#.#...#.....#.......#...#.#.#.....#...#...#.#.#.#...#.#.#.....#...#.#...#.....#.#...# +#.#.#.#.#####.#.#.#.###.#.###########.#.#.#.#.#.#####.#.#.#########.#####.#.#####.#.#####.#.#.#.###.#.#.#####.#.#.###.#.#.#.###.#####.#.##### +#.#.#.#.....#...#.#.#...#.#...........#.#.#...#...#...#.........#.....#...#.#.....#.....#.#.#...#...#.#.#...#.#...#...........#.............# +#.###.#####.###.#.#.#.###.#.#.#########.###.#####.#############.#.###.#.#####.#####.#####.#.###.#.###.#.#.#.#.#####.#########.#.#.#######.#.# +#.....#...#...#.#.#...#.#.#.#.........#.#...#.....#.....#.....#...#...#.........#.#.#.....#...#.....#.#.#.#...#.#...#.#.....#.#.#...#...#...# +#.#.###.#.###.#.###.#.#.#.#.#####.#####.#.###.#####.#.#.#####.#####.#######.###.#.#.#.#####.#.#####.#.#.#.#####.#.###.#.#.#.#.#.###.#.#.###.# +#.#...............#...#.#.#.......#...#.....#...#...#.#.....#...#.......#...#.#...#...#...#.#.....#.#.#.#.#.....#...#...#.#.#...#.#.#.#.....# +#.#.#.#####.#.###.#####.#.#.#######.#.#########.#.###.#####.#.###.#######.#.#.###.#######.#.###.#.#.###.#.#.###.###.#####.#.###.#.#.#.####### +#...#...#.#.....#.......#.#.#.......#.........#...#...#...#...#.....#.......#.....#.....#.......#.#.#...#.#.#.....#...#...#.....#.#.#.......# +#.#####.#.#.###########.#.#.#.#########.#####.#####.###.#.#####.#####.#####.#.#######.#.#.###.#####.#.#.#.###.#######.#.#######.#.#.###.#.#.# +#.......#...#.......#...#.#.#.#.......#...#...#...#...#.#.......#...#.#.....#.#.......#.#...#.......#...#...#.#.....#.#.#.........#.........# +#########.#.#.#####.#.#.#.#.#.#.#.###.#.#.#.#.#.#.#.#.#.#########.#.#.#.#.###.#.#.#.###.#########.###.#####.#.#.#.###.#.#####.#.#####.#.###.# +#.....#.#.#...#...#...#...#.#.#.#...#...#...#.#.#.#.#.#.........#.#...#.....#...#...#.#.........#.#.......#.#...#.....#.#...#...............# +#.#.#.#.#.#.###.#.###.#.###.#.#.###.#.#####.###.#.###.#.#.#######.#########.#########.#########.#.###.###.#.#######.###.#.#.###.###.#.#####.# +#...#...#.#...#.#...#.#...#.#.....#.#.......#...#...#.#.#.#.....#.......#...#.......#...#.....#.#.....#...#.#.......#...#.#.....#...#.....#.# +###.#.###.#.#.#.#####.###.#####.###.#########.#####.#.#.#.#.###.#########.###.###.#.#.#.#.#.###.#####.#.###.#.###.#.###.#.#######.#.#.#####.# +#...#.#.....#.#.......#.#.......#...#...#.....#...#.#.....#...#...........#...#...#...#.#.#.#.........#...#.#.#.#.#...#.........#.#.#.#.....# +#.#.#.#.###.#.#.#######.#########.#.#.#.#.#####.#.#.#########.###############.#.#.#####.#.#.#.###.###.###.#.#.#.#.###.#######.###.#.#.#.##### +#.............#.............#.....#.#.#...#...#.#...........#.#.......#.......#.#.#...#...#.#.......#.....#.....#...#.#...#...#...#.#.#...#.# +###.#.###.#.#.#############.#.#####.#.#####.#.#.#.#.###.#.#.#.#.#####.#.#.#.#.#.#.#.#.#####.#######.#########.#####.#.#.#.#.###.#.###.###.#.# +#.........#...#.......#.....#.#.....#.......#...#.#.....#...#.#.#...#...#.#.#.#.#.#.#.#...#.#.....#.#.......#.#.....#.#.#.#.#...#.#.....#.#.# +#.#.#.#####.###.#.#####.#####.###.###############.#.#.#.#.###.#.#.#.#####.#.#.#.###.#.#.#.#.#.#.#.#.#.#####.#.#.#.#.#.#.#.###.###.#.###.#.#.# +#.#.....#.......#.#.....#...#...#.#.............#...#...#.....#...#...#...#.#.#.....#.#.#.#.....#.#.#.#.....#.#.#...#...#.#...#.#.#.#...#...# +#.#.#.#.#######.###.#####.#.###.#.#.#####.###########.#################.###.#.#######.#.#.#.#######.#.#.#####.#.#########.#.###.#.#.#######.# +#...#...#...#...#...#.#...#.#...#.#...#.#...........#.#.....#...........#.#.#.#.......#.#.#.#.......#.#...#...#.#...#...#.#...#.#.#.........# +#.#.#.###.#.#.###.###.#.#.###.###.###.#.#######.#####.#.#.#.#.###########.#.#.#.#######.#.#.#.#######.###.#####.#.#.#.#.#.###.#.#.#.#.####### +#...#.#...#.......#.....#...#.#...#...#.......#.......#.#.#...#.....#.......#.#.#.....#.#...#...#.......#.......#.#.#.#.#...................# +###.#.#.###.#.#.###.#######.#.#.###.#########.#.#########.#####.###.#.#########.#.#.###.#######.#######.###########.#.#.#######.#.#.###.#.#.# +#.#.#...#...#.#.#...#.....#.#.#.#...#.......#.............#...#...#.............#.#.#...#...#...#.......#...#.......#.#.........#.#.....#.#.# +#.#.#.###.###.#.#####.###.#.#.###.###.#####.#####.###.###.#.#.###################.###.###.#.#.###.#.#.###.#.#.###.#.#.#.###.#####.###.#.#.#.# +#...#.#...#...#.......#.#...#.....#.....#.........#...#.....#...#.....#.........#.....#...#...#.......#...#.#.#...#.#.....#.......#.#.....#.# +#.###.#.###.#########.#.#.#############.###########.###.###.#.#.#.###.#####.#####.#####.#######.###.###.###.#.#.###.#####.#########.#.#.#.#.# +#.....#...#...............#.............#...#.....#.#...#...#.#.....#...#...#...#.#.....#.....#.#.....#.#...#.#.#...#.#...#.....#.........#.# +#####.###.###.#############.#######.#.###.#.###.###.#.###.#.###########.#.###.#.#.#.###.#.#.#.#.#######.#.#####.#.###.#.###.###.#.###.#.#.#.# +#...#...#...#.#.......#...#...#...#.#.#...#...#...#.#...#.#...........#.#.#...#...#.#.....#.#...#.....#.#.....#.#...#.#.#.....#.......#.#...# +#.#.#.#.#.#.#.#.#####.#.#.###.###.#.###.#####.#.#.#.###.#.###.#######.#.#.#.#######.#.#####.#####.###.#.#####.#.#.#.#.#.#.###.#.#.###.#.#.#.# +#.#...#.#.#.#.#.#.#...#.#...#.#...#.....#...#.#.#.#.#...#...#.#.....#...#.....#...#.#.....#.....#...#...#...#.#...#...#.#.....#.#...#.....#.# +#.###.#.#.#.#.#.#.#.#####.#.#.#.#.#######.#.#.###.#.#.#####.###.###.#########.#.###.#####.#.#.#.###.#####.#.#.###.###.#.###.#.#.#.#.#.#.#.#.# +#.#.............#.......#...#.#.#.........#.#...#.#.#.#...#.....#.#.#.....#.#.#.#...#...#.#...#.#...#.....#.#.#.......#...#.#.#.#.#.....#...# +#.###.#####.#####.#####.#.###.#.#####.#####.###.#.#.#.#.#.###.###.#.#.###.#.#.#.#.###.###.#####.#.###.#######.#.#####.###.#.#.###.###.#.#.### +#...#.....#.#.#...#.......#...........#.......#.#...#.#...........#...#...#...#.#.#.....#.....#.......#...#...#.....#...#.#.#.#.....#...#...# +#.#.#####.#.#.#.#.#.#######.###.#######.#######.#.###.#########.#.#####.#####.#.#.#####.###.#.#########.#.#.#######.#####.#.#.#.#####.#.#.#.# +#.#.#.....#.#...#...#.#.....#.........#.#...#...#...#...#.....#.#...#...........#.....#.....#.....#.....#...#.....#.#.....#.#.....#...#...#.# +#.#.###.###.#.#######.#.#############.#.#.#.#.#########.#.###.#.#.#.#.#####.#########.###.###.###.#.#########.#.#.#.#.#########.###.#.#.#.#.# +#.#...#.#...#...#.....#.....#.......#.#...#.#.........#...#.#.#.#...#.....#.........#...#.#...#...#.#.......#.#.#...#.#.......#.#...#...#...# +#.###.#.#.#####.#.###.#####.#.#####.#.#####.#######.#.#####.#.#.###.#####.#####.###.###.#.#.#.#####.#.###.###.#.###.#.#####.#.###.###.#.#.### +#.#...#.#.#...#.#...#.#.....#...#...#...#.......#.#.#.....#.......#.#...#.#...#...#...#.#.#.#.#.....#.........#.#...#...#...#...............# +#.#.###.#.#.#.#.###.#.#.#######.#.#####.#.#####.#.#.###.###.#####.#.#.#.#.#.#.###.#####.#.#.#.#.#######.#######.###.###.#.#######.#.#.#.#.#.# +#.#...#...#.#.#...#.#.#.#.......#.....#.#.....#...#.#...#.........#...#...#.#.....#.....#...#.#.....#...#.....#...#...#...#.........#...#.#.# +#####.#######.###.#.###.#.#.#########.#.###.#.#.###.#####.#####.#######.###.#####.#.###############.#####.###.#.#.###.#####.#########.###.#.# +#.....#.......#...#...#.#.#.#.....#...#.#...#...#...#.....#...#.#...........#...#.#...#...........#.......#...#.#...#.#...........#...#...#.# +#.#######.#.###.#####.#.#.#.#.###.#.###.#.#####.#.###.#####.#.###.###########.###.###.###.#######.###.#####.###.###.###.#########.###.#.###.# +#.#.....#.#...#.......#...#.#.#.#.......#.....#.#.#...#...#.#...#.....#.....#.....#...#...#.....#...#.#...#.#...#.#...#.....#...#.......#...# +#.#.###.#.#.#.#.#####.#####.#.#.#####.#######.#.#.#.###.###.#.#.#####.#.#####.#####.###.###.#######.#.#.#.#.#.###.###.#####.#.###########.#.# +#.#...#.#...#...#...#.#.....#.#.......#.....#.#.#.#...#...#...#.......#...#.....#...#.....#.........#.#.#.#.#...#...#.....#.#.............#.# +#.###.#.###.#####.#.#.#.#.###.#.#####.###.#.#.#.#.###.#.#.###.###########.#.#####.###.###.#.#########.###.#.###.#.#.#####.#.###.#.#########.# +#.....#.....#...#.#.#...#.....#.#...#.....#.#.#.#...#.#.#...#...#.......#.#...#...#...#.#.#...#.#...#.....#...#...#.#...#.#...#.#.#.#.......# +#.#########.#.#.#.#.#.###.#####.#.#.#########.#.###.#.#####.###.#.#####.#.###.#.###.###.#.###.#.#.#.#####.###.#####.#.#.#.###.#.#.#.#.#####.# +#...#.....#.#.#...#.#.#...#.......#.........#...#...#.......#.#...#.....#.....#.#.......#.#...#...#...#.....#.#...#.#.#.#.#...#.#.#...#...#.# +###.#.#####.#.#####.###.###.###############.#.###.#.#######.#.#####.#########.#.#########.#.#######.#.#.#####.###.#.#.#.#.#.###.#.#####.#.### +#.#.#...#...#...#...#...#...#...#...#...#...#.#.....#.....#.#...#.#.........#.#.....#...#.#.......#.#.....#...#...#...#.#...#...#...#...#...# +#.#.###.#.#.###.#.###.###.#.#.#.#.#.#.#.#.###.#.#.###.###.#.#.#.#.###.#####.#.#####.#.#.#.#####.#.###.#.###.###.#######.#######.###.#.#####.# +#.#...#.#.....#.#...#.#...#.#.#...#...#.#.#.....#.#...#.#.#...#...#.........#.....#...#...#.....#...#.#.#...#.......#...#.....#...#...#...#.# +#.###.#.###.###.###.#.#.#.#.#.###.#######.#.###.###.###.#.#######.###.#.###.#####.#########.###.###.#.#.#.#######.###.###.#.#.#.#####.#.###.# +#...#...#...#...#.#.#.#...#.#...#.#...#.......#...#.....#.........#...#.#.....#.....#.......#.#.#.#.#...#.......#.....#...#.#.#.#...#...#...# +#.#####.#.#.#.###.#.#.###.#.###.###.#.#.###.#.###.#####.###########.#.#.#.###.#.###.#######.#.#.#.#.###.#######.#.#######.#.#.###.#.###.#.### +#.......#...#...#.#.#.#...#...#.....#.....#.#...#...#...#.....#.....#.#...#.#.#.....#...#...#.....#.#...#.....#.........#.#.#.....#...#.#...# +#.#########.###.#.#.#.#.#####.#.###.#.###.#.#.###.###.###.###.#.#.#########.#.#.#####.#.#.###.#####.#.###.###.#.#######.#.#.###.#.###.###.#.# +#...#.#...#...#.#.#...#.#...#...#.....#...#.#...#...#...#.#.....#.#.........#.#.....#.#.#...#.#...#.#.#.#...#.#.#.....#.#.#.#.#...#.........# +###.#.#.#.#.###.#.#####.###.###.#.###.#.#######.###.###.#.#.###.#.#.#.#######.#####.#.#.###.#.#.#.#.#.#.###.#.#.#.#.###.#.#.#.###.#.###.###.# +#...#.#.#...#...#.....#...#...#...#...#.........#...............#...#.......#.....#.#.#.....#.#.#...#...#...#...#.#.....#.#.#.........#...#.# +#.###.#.#.###.###.#######.#.#.#####.#.#.#######.#.#####.#.###.###.#########.#.###.#.#.###.###.#.#######.#.#######.#########.#.#.#.#######.#.# +#.....#.#.....#.........#.#.#...#...#.........#...............#...#.....#...#...#.#...#...#.....#.....#.#.......#.#.........#.#...#.....#...# +#####.#.#.#####.#.###.#.#.#####.#.###.#.###.#########.#.###.#.#.#.#####.#.#.#.#.#.#####.###.#########.#.#######.#.#.###.#####.###.#.###.###.# +#.#...#...#.#.........#.#.#.....#.....#.#...#.....#.#...#...#...#.......#.#.#.#...#.#...#...#.......#.......#...#.............#...#...#.....# +#.#.#####.#.#.#####.#.###.#.###.#####.#.#.#.#.#.#.#.###.#.#######.#.###.#.#.#.#####.#.###.###.###.#.#####.###.###.#.###.#####.#.#.###.####### +#.#.#.......#.......#.......#.......#...........#...#...#...#.....#.#...#.#.#.#...#.....#.#...#...#...#...#...#.#.....#.....#.#.#.#...#.....# +#.#.###.#.#.###.#####.###############.#.#.#.#.#.#####.#.###.#######.#.###.#.#.#.#.#.#####.#.###.#####.###.#.###.###.#.#####.###.#.#.###.#.### +#.....................#.........#.....#...#.#.#.....#...#...........#...#.#.#.#.#...#...............#...#.#.#.......#.....#.#...#...#...#...# +#.###.###.#.###.#.#.###.#######.#.###.#.###.#.#####.###.#################.#.#.#.#####.#####.#.###.#####.###.#.#.###.#####.#.#.###.#######.#.# +#...#.....#.....#.#...#...#...#.#.#...#...#...#...#...#...........#.......#.#.#...#...#.......................#.#.......#...#.#...#.........# +#.#.#####.#######.###.###.#.###.#.#.#.#.#.#######.#.#############.#.#######.#.#####.###.#######.#.#.#########.#.#.#.###.#####.#.#####.#.###.# +#S#...............................................#.................#.......#...........#.........#...........#.......#...............#.....# +############################################################################################################################################# diff --git a/2024/day-16/solution-1.sh b/2024/day-16/solution-1.sh new file mode 100644 index 0000000..c67ebd6 --- /dev/null +++ b/2024/day-16/solution-1.sh @@ -0,0 +1,196 @@ +#!/usr/bin/env bash + +FUNCNEST=99999 +FILE=test-input-1 + +# Load map +read -r -a MAP_ARRAY <<< "$( < "$FILE" paste -s -d "" | sed -E 's/(.)(.)/\1 \2 /g' )" +#read -r -a CHECKPOINT_ARRAY <<< "$( < "$FILE" paste -s -d "" | sed -E 's/(.)(.)/\1 \2 /g' )" +MAP_WIDTH=$(( $( head -1 "$FILE" | wc -c ) -1 )) +MAP_LEN=${#MAP_ARRAY[@]} +MAP_HEIGHT=$( < "$FILE" wc -l ) +printf "Map len: %s Map width: %s Map height: %s\n" "$MAP_LEN" "$MAP_WIDTH" "$MAP_HEIGHT" +DIR_UP=$(( - MAP_WIDTH )) +DIR_DOWN=$MAP_WIDTH +DIR_LEFT=-1 +DIR_RIGHT=1 + +print_map () { + printf "%s " "${MAP_ARRAY[@]}" | fold -w $(( MAP_WIDTH * 2 )) + printf "\n" +} + +# Get starting position +for (( i=0; i