From b20aa6fbdc72d58e75b6394bca8b561b39ae6bd5 Mon Sep 17 00:00:00 2001 From: Fabian Schmidt Date: Mon, 16 Dec 2024 11:24:17 +0100 Subject: [PATCH] prepare files y2024d16 --- y2024/resources/16_input.txt | 141 +++++++++++++++++++++++++++++++++++ y2024/src/bin/d16.rs | 27 +++++++ y2024/src/days/d16.rs | 64 ++++++++++++++++ y2024/src/days/mod.rs | 2 + 4 files changed, 234 insertions(+) create mode 100644 y2024/resources/16_input.txt create mode 100644 y2024/src/bin/d16.rs create mode 100644 y2024/src/days/d16.rs diff --git a/y2024/resources/16_input.txt b/y2024/resources/16_input.txt new file mode 100644 index 0000000..806a182 --- /dev/null +++ b/y2024/resources/16_input.txt @@ -0,0 +1,141 @@ +############################################################################################################################################# +#.#...................#.........#...............#...#...........#...........#.....#.............#...............................#.#........E# +#.#.#.###############.###.#####.###.###.#######.#.#.#####.#####.#######.#.#.#.###.#############.#.#####.#.#####.#####.#.#######.#.#.#.####### +#...#.........#...#...#...#...#...#.#...#...#...#.#.....#.#...#...#.......#.#...#...#.........#.....#.#...#.....#...#.#...#.#...#...#...#...# +#.###########.###.#.###.###.#####.###.###.#.#.###.###.#.#.#.#####.#.###.###.###.###.#.#######.#####.#.#####.#######.#.###.#.#.#########.#.#.# +#...#.#.....#...#...#...#.#...........#...#.#.#...#.......#.....#.#.#.......#...#.....#.#...#...#.#...#...#.......#.#...#.#...#...#...#.#.#.# +###.#.#.#.#####.#.#####.#.#.#########.#.###.#.###.#.#.#####.#.###.#.#######.#.#########.#.#.###.#.###.#.#.#######.#.###.#.#.###.#.#.#.#.#.#.# +#.#.#.#.#.......................#.....#...#.#.#...#.#...#.#.#.....#.#.....#...#...#.......#.....#.....#.#...............#.#...#.#.#.#...#.#.# +#.#.#.#.#.#.#.#.###.#.###.###.#.###.#.###.#.#.#.###.#.#.#.#.#######.#.###.#####.#.#####.###########.#####.#.#####.###.#.#.###.#.#.#.#####.#.# +#.#.#...#...#.#...#...#...#...#...#.#.....#.#.#...#.#...............#.#.#.......#.....#.#.#.......#.......#.#.....#...#.#...#...#.#.......#.# +#.#.#########.###.#####.###.#####.###.#####.#.###.#.#.#.#####.#.###.#.#.#############.#.#.#.###.#.###########.#####.#.#.#.#.#####.#######.#.# +#.#.......#.....#...#...#...#...#.....#.#...#...#.#.#.#.....#.#...#.#...#...#.......#.#.#...#...#.............#.....#.#.#.#.#...#...#...#.#.# +#.#######.#.###.###.###.#.#####.#####.#.#.#####.#.###.#####.#.###.#####.#.#.#.#####.#.#.#####.#.#####.#########.#######.###.#.#.###.#.#.###.# +#.....#.#...#.#...#...#.#.#.......#.....#.#.#...#...............................#...............#...#.#...#.....#.......#...#.#.....#.#.....# +#.#.#.#.#####.###.###.###.###.###.#.#.###.#.#.#######.###.#.###.#.#.#.###.#.#####.###.#####.#.###.#.###.#.#.#.###.###.###.#######.###.#####.# +#.#.#...........#...#.....#...#.....#.....#...#.............#.#.#...#.#.....#...#.#...#.......#...#.....#.#.#.#...#...#...#.....#.....#...#.# +###.#############.#.#######.#.#####.#.#######.#.#############.#.#.###.#.#####.#.#.#.###########.#########.#.###.###.#.###.#.###.#######.###.# +#...#.......#.....#.#.......#.#...#.#.......#.#.#.......#.....#...#...#.......#.#.#.#.....#.....#.........#.#...#...#...#.....#...#.....#...# +#.###.#####.#.#.###.#.###.#####.#.#########.#.#.###.#.###.#.#.###.#############.#.#.#.#.#.#.#####.#########.#.#####.###.#.#######.#.#####.### +#...#...#.#...#.......#...#.....#.#...#.....#.#...#.#.#...#.......#...........#.#.#...#...#.....#.#.........#...#...#.#.#.#.....#.#.........# +#.#.###.#.###############.#.#####.#.#.#.#####.###.###.#.###########.###.#####.#.#.#####.#.#####.#.#######.#.###.#.###.#.#.#.###.#.#.###.#.#.# +#.#...#...........#.....#.#.#...#.#.#...#...#...#...#.#.#.....#...#.#.#.#.....#.....#...#.#.#...#...#...#.....#...#.#...#.#.#.#...#.#...#.#.# +#.#.#.#.#######.###.###.###.#.#.#.#.#####.#####.#.#.#.#.#.###.###.#.#.#.#####.#####.#.###.#.#.#####.#.#.#####.#####.#.#####.#.#####.#.###.#.# +#.#.#.........#.#...#.#.....#.....#...#.#.......#.#.#.#.#...#...#.#...#.....#.#.....#.#...#.#.#...#.....#.......#...#.#.....#...#...#.....#.# +#.#.#.#########.#.###.#######.#######.#.#.#.#######.#.#.#.#.###.#.#.#.#####.###.#####.#.###.#.#.#.#####.#.#####.###.#.#.#######.#.#########.# +#.#...#.........#.#...#.....#.........#.#...#.......#.#...#...#.#...#.#...#.....#...#.#.#...#.#.#...#...#.#.........#...#.......#...#.....#.# +#.###.#.###.#####.#.#.#.#.#####.#.#####.###.#.#######.#####.#.#.#.###.#.#########.#.#.#.###.#.#.#####.###.#########.#######.#######.###.#.#.# +#...#...#...#...#.#.#.#.#...#...#.#.#.....#.#.#...........#.#...#.#...#.....#...#.#.#.#.....#.#...#.....#...#.....#.#.......#.....#...#.#...# +###.#.###.#.#.#.#.###.#.###.#.###.#.#.#.###.#.###.#.#####.#.#####.#.###.#.#.#.#.#.###.#####.#.###.#.###.#.#.#.###.#.###.###.#.###.###.#.###.# +#...#.....#...#.#...#.......#.....#...#.#.....#...#.#...#.#.#...#.#...#.#.#...#.#...#.....#.#.#.....#.....#...#...#...#.#...#.............#.# +#.###.#####.###.###.#.#.###.#.#######.#.#.#####.#.###.#.#.#.#.#.#.###.#.#.#####.###.#####.#.#.#.###.#.#.#######.#####.#.#.#####.#.#.###.#.#.# +#...#.....#...#.#...#...#...#.#.......#...#...#.#.#...#.#.#...#.....#.#.#.#.#...#...#...#.#.#.#...#.#.........#.#...#...#.#.#...#...#...#...# +###.#.###.#.#.###.#######.###.#.#####.#####.#.#.###.###.###.#.#####.#.###.#.#.#.#.#.#.#.#.#.#.#.#.#.#########.#.#.#.#####.#.#.#######.#.###.# +#.#.......#.#.....#.....#.#...#.....#.......#.#...#.#.#.......#.....#.....#.#...#.#...#.#.#.#.#.#.#...#.#...#.#...#.........#.....#...#.....# +#.###.#.###.#####.#.###.#.#.###.###.#########.#.#.#.#.#########.###########.###.#.#####.#.#.#.#.#.#.#.#.#.#.#.#######.#####.#####.###.#.#.#.# +#.......#...#...#.#.#.#.#.#.#.#...#.....#.....#.#.#.#.......#.......#...........#.....#.#.#.#.#.#.#...#.#.#...#...#...#...#.....#...#.......# +#.#.#.#.#.#.#.#.###.#.#.#.#.#.###.#.###.#.#######.#.#.#.###.#########.#########.#####.###.#.#.###.#.###.#.#######.#.###.#.#####.###.###.###.# +#...#.#.#.....#.#...#.#.#.....#...#.#...#.#.#.........#.#.#.......#...#.......#.....#.#...#.#.....#...#...#.......#...#.#.........#.........# +#.###.#.###.#.#.#.###.#.#.###.#.#####.#.#.#.#.#.#####.#.#.#.#.###.#.###.#####.#####.#.#.#######.#####.#.#.###.###.###.#.#####.###.#####.###.# +#.#...#.#.....#...#...#.#.....#.#.....#.#.#...#.#.....#...#...#.#...#.#...#.#...#.....#.#.....#.......#.......#.....#.......#.#.......#.....# +#.#.###.###.#.#####.#.#.#####.#.#.#####.#.###.#.#.#######.#####.#####.###.#.###.#####.#.#.###.#.#.###########.#####.#######.#.#########.###.# +#.#...#.....#.....#.#.#.........#.#...#.#...#.#.#.......#.#.....#...........#.#.....#.#...#.#...#.......#...#.#.......#.....#...............# +#####.###.#.#.###.###.#####.#.###.#.#.#.###.###.###.#####.#.###.#####.#.###.#.#####.#.#####.#.#######.#.#.#.###.#####.#################.##### +#.......#...#.....#.....#.#.#...#.#.#.#...#...#.....#.....#...........#...#.#.....#.#...#...#.......#.#...#.#.......#.......#.......#.......# +#.#######.#.#.#####.###.#.#.###.#.#.#####.###.#.#####.#####.#############.#.#.###.#.###.###.#.#####.#######.#.#########.#.#.#.#####.#.#.###.# +#.........#...#.....#...#.#...#...#.....#.#.#.#...#.#.#.......#.....#.....#.#...#...........#...#...#.......#...#.......#.#.#...#.#.......#.# +#.#######.###.#.#####.###.###.#######.###.#.#.###.#.#.###.###.#.###.###.#.#.###.#.#.#.#######.###.###.###.#####.#.#.#####.#.###.#.#########.# +#.......#.#.....#...#.....#.#.........#...#.#...#...#...#...#.#...#...#...#.#...#.#.#.#.....#.#...#...#...#.....#.#.#.....#...#.#.....#...#.# +#.###.#.#.#.#.#.#.#.#.###.#.#####.#.###.###.###.#######.#.#.#.#.#####.#####.###.#.#.###.###.#.#.#####.###.#.#####.###.#####.###.#.###.#.#.#.# +#.....#.#.#.#.#.#.#.....#.#...#...#.#...#.....#...........#...#.#...#.#...#...#.#.......#.#...#.#...#...#...#...#.....#...#.......#...#.#...# +#######.#.#.#.#.#.#####.#.#.#.#.#####.###.#.#############.#####.#.#.#.#.#.###.#.#.#######.#####.#.#.###.###.#.#.#########.#############.###.# +#.#.....#.....#.#.#...#.#...#.#.......#...#.#.......#...........#.#...#.#.....................#...#...#...#...#.......#.....#...#...#...#.#.# +#.#.#####.#####.#.###.#.#####.#########.#####.#####.#.###########.###.#.#########.#############.#####.###.###########.#.#.#.#.###.#.#.###.#.# +#...#...........#.#...#.#.....#.#.....#.......#...#...#...#.....#.#.#.#...#...#...#...........#...#...#.....#.......#.#.#...#.#...#...#.....# +#.###.###########.#.#.#.#.#####.#.#.###.#.#.###.#.#####.#.#.###.#.#.#.###.#.#.#.###.#########.#####.###.#####.#.#####.#.#.###.#.############# +#.....#.......#.....#.#.#...#...#.#...#.#.......#.#.....#.#.....#.#...#...#.#.#...#.#.#.....#.....#.#.........#...#.....#...#.#.....#.......# +#######.#######.#####.#.###.#.#.#.###.#.#######.#.#.#####.#.#.#.#.#####.###.#.###.#.#.#.###.#####.#.#.#.#########.#.#.#.###.#.#####.#.#####.# +#.......#...#...#...#.#...#.#.#.#...#.....#.....#.#...#.#.#.#.#...#.....#.#.#...#.#.#...#...#.....#.#.........#...#.#...#.........#.....#...# +###.#.#.#.#.#.###.#.###.#.#.###.#.#########.#####.###.#.#.###.#.###.#####.#.###.#.#.#.###.#.#.#####.#########.#.###.#.###.###.#####.#####.### +#...#.#...#.....#.#.....#.#...#...#...#.....#...#.#...#.......#.#...#.....#.#.#.#.#.#.#...#.#.#.......#...#...#...#...#.#.#...#...#...#...#.# +#.###.#########.#.#######.###.#####.#.#.#####.#.#.#.#############.###.#.#.#.#.#.###.###.###.#.#.#####.#.###.#####.#####.#.###.#.#.###.#.###.# +#.....#.#...#...#.....#.....#.......#...#.....#.....#.............#.....#.#.#...#...#...#...#.#...#.#.#.....#...#.#...#...#...#.#...#.#...#.# +#.#####.#.#.#####.###.#.###.#############.#.###.###.#.#############.#.#.###.#.###.###.#####.#.###.#.#.#.#####.###.#.#.#.###.#.#.###.#.#.#.#.# +#.......#.#.....#...#.#.....#.....#.....#.#.#...#...#...#...............#...#.....#.........#.#.....#.#.......#...#.#...#...#.#.#.#.#...#.#.# +#########.#####.###.#.###.#####.#.###.#.#.#.#.###.#.###.###.###.#######.#.#########.#######.#.###.###.#######.#.###.#####.###.#.#.#.#.###.#.# +#.....#...#.....#...#...#...#...#.....#.#.#.#...#.....#.....#.#.....#...#...#.#.......#.....#.......#.....#...........#...#...#.#.#.#.#...#.# +#.###.#.#.#####.#.#.###.###.#.#.#####.###.#.#.#.#####.#######.#####.#.#####.#.#.#####.#.###########.#####.###########.###.#.###.#.#.###.###.# +#.#.....#.#...#...#...#.......#.#.....#...#.#.#.....#.#.......#.....#.#...#.#.........#...........#.....#...........#.#...#...#.#.......#...# +#.#######.#.#.#######.#.#####.###.#.###.###.###.#.###.###.###.#.#####.#.#.#.###.#####.#####.###########.#######.###.#.#.#.###.#.#########.#.# +#...#.#...#.#.#.....#.#...#...#...#...#...#.....#.........#...#.#.....#.#...#...#.....#.....#.........#.....#...#...#.#.#.#...#.....#...#.#.# +###.#.#.###.#.#.###.#.###.###.#.#####.#.#.#.#######.#####.#####.#.#.###.###.#.#.#######.#####.#####.#######.#.#.#.###.#.#.#.#######.###.#.#.# +#...#...#...#.#...#.#...#...#.#.....#.#...#...#...#.#...#.#.....#.#...#.#.#...#.......#...#...#...#.......#...#...#.#...#...#...#...#...#.#.# +#.###.###.###.###.#.###.###.#.#####.#.#.###.###.#.###.#.###.#########.###.#.#.#######.###.#.###.#####.#.#.#########.#.#######.#.#.###.###.#.# +#...#.#...#.#...#.#...#.#...#.#.#...#.#.#...#...#...........#.........#.....#...#.........#.#.......#...#.........#.#.#.......#.............# +###.#.#.###.###.###.###.#.###.#.#.###.#.###.#.###############.###.#####.#######.#.#####.#.#.#####.#.#.#.#.#######.#.#.#.###########.###.###.# +#...#.#...........#.....#.#.....#...#...#...#.....#.....#...........#...#...#...#.....#.#.#.....#.#.#.#.#.#...#...#...#...........#...#...#.# +#.#####.#.###.###.#.#####.#####.###.#####.#.#.#.#.###.#.#####.#####.#.###.#.#.#######.#.#######.#.#.#.#.###.#.###.###.###.#######.#.#.###.#.# +#...#...#...#.#...#.#...........#.#.#.....#.#...#.#...#.....#.#...#...#...#.#.#.....#.#.......#.#.#.#.#.....#...#...#.....................#.# +###.#.###.###.#.###.#####.###.#.#.#.#####.#####.#.#.#######.###.#.#.###.###.#.#####.#.#######.#.#.#.#.#########.###.#######.#.#.###.#######.# +#...#.#.#.#.......#.....#.........#.....#.......#...#.....#.....#.#.#...#.#...#.....#.#.....#...#.#.........#...#...#.....#.#.#...#.....#...# +#.###.#.#.#.#####.#####.#.#######.#####.#.#.###.#####.#.#.#######.###.###.#####.###.#.#.#.#.###.#.#####.#####.###.###.###.#.#.###.#.#.###.### +#.#...#...#.#...#.#.....#.#.#.........#.#.#.#...#.....#.#...#...#.....#.......#...#.#...#.#...#...#.....#...#.#.......#.#.#...#...#.#...#...# +#.#.#######.#.#.#.#####.#.#.#.#########.#.#.#####.#####.#####.#.#######.#####.#.#.#######.###.###.#######.#.#.#.#######.#.#####.#####.#.#.#.# +#...#.......#.#.#.#...#...#.....#.......#.#.........#.#.....#.#.......#.#...#...#.#.........#.#...#.....#.#...#.........#.......#.....#.....# +#.###.#.#####.#.#.#.#.###.#####.#.#.#.###.#########.#.#.#.#.#.#.#####.#.#.#.###.#.#.#######.#.#####.###.#.#####.#.###############.###.#.#.### +#.#...#.#...#.#.#...#.#...#...#...#.......#.......#...#...#.#.#.#...#...#.#.....#.......#.#.#...#...#.#.#.#.#...#.............#.......#.#...# +#.#.#.#.#.#.#.#.#.###.#.###.#.#.#########.#.#####.#######.#.#.#.#.#.#######.#.#########.#.#.###.#.###.#.#.#.#.#########.#######.#####.#.#.#.# +#.#.#.#.#.#.#.#...#...#.#.#.#...#.......#.#.#...#.#.....#.#.#.#.#.#.........#.......#.....#...#...#...#...#...#.......#...........#...#.#.#.# +#.###.#.#.#.#.###.#.###.#.#.#####.#.###.#.#.#.###.#.###.###.#.#.#.#####.#.###.#####.#.#####.#.#####.#.#########.#####.###.#########.#.###.#.# +#.....#.#.#...#.....#.#.#.#.#...#.#.#...#.#.#.....#.#.....#...#.#.....#.#.#.........#.#...#.#.........#.....#...#...#...#.#.#...#...#.....#.# +#######.#.###########.#.#.#.#.###.#.#.#####.#.#####.#####.#####.#######.#.#.###########.#.#####.#####.###.#.#.#####.###.#.#.#.#.#.###.#.#.#.# +#...#...#.......#.....#...#.#.....#.#.#.....#.....#...#.....#...#.......#.#.#...#.......#.......#...#.#...#...#.....#.#.#.#.#.#...#.....#...# +#.#.#.#########.###.#.###.#.#####.#.#.###.#######.#.#.###.#.#.###.#########.#.###.#.#.#############.#.#.#.#######.#.#.#.#.#.#.#####.#.#.#.#.# +#.#.#.....#...#...#.#...#.#.....#.#.#.....#.......#.#.....#...#.#.......#...#.....#.#.....#.#.......#...#...#.....#.#.#.#...#.....#.#.#...#.# +#.#.#####.###.###.#.#.###.#####.###.#########.###########.#####.#.#####.#.#####.###.#.###.#.#.###.#########.#.#.###.#.#.###.#####.#.#.#.#.#.# +#.#.....#.........#.#...#.....#...#.........#.#...........#.....#.#.#...#.#...#.#.#.#.#.....#...#...........#.#.#.#...#.#.#.#...#.....#...#.# +#.#####.#####.#.#######.#####.###.#.#######.#.#.###.###########.#.#.#.###.#.#.#.#.#.#.#####.###.#####.#######.#.#.#.###.#.#.#.#.###.#.#.#.#.# +#.#...#.....#.#.#.......#.....#...#.....#.#.#.#.#...#.#.......#.....#...#...#.....#.#...#.#.#.#.#...#...#.....#.#...#...#...#.#.#...#.....#.# +#.#.#.#####.#.#.###.#####.#####.#######.#.#.#.###.###.#.###.#.#####.###.#####.#####.#.#.#.#.#.#.#.#.###.#.#####.#####.###.###.#.#.#.#.#.###.# +#.#.#.....#.#.#...#.......#...#...#.....#.#.#.....#...#...#.#.......#.......#...#...#.#.#.....#...#...#.#...#...#...#.#.........#.#.........# +#.#####.#.#.#.###.#########.#.###.#.#.###.#.#######.#.###.#.#######.#.###.#.###.#.###.#.#########.#####.#.###.###.#.#.###########.#.#.#.#.### +#...#...#.#.#.#.#...#.....#.#...#...#.....#.#.......#.#...#...#.......#...#...#.#...#.#.#...#.....#.....#.#...#...#.#...........#.#...#.....# +###.#.#####.#.#.###.#.###.#.###.###.#####.#.###.###.###.#####.#########.#####.#.###.#.#.#.#.#.#####.###.#.#.###.###.###########.#.#########.# +#...#.......#.....#...#.#...#.#...#.#.....#...#...#.....#...#.#.......#.#.....#.......#.....#.#...#.#...#.#...#.#.#.....#.....#.#...........# +#.#####.#########.#####.#####.###.#.#########.###.#.#####.###.#.#####.#.#.#.#.#########.#.#.#.#.###.###.#.###.#.#.#####.#.#.###.#.#.###.#.### +#.....#.....#...#...#.........#...#...........#.#.....#.....#...#.....#.#.#.............#.#...#...#...#.#.#.#.#.......#.#.#.....#...#...#.#.# +#.###.#.#.###.#.###.#.#.###.#.#.###.#.#########.#####.#.###.#####.#####.#.#.#############.#######.###.#.#.#.#.###.#####.#.#########.#.###.#.# +#.#...#...#...#.....#.#...#...#.#...#...#.........#...#...#.....#.......#.#.#.....#.....#...#.....#.#.....#.#...#.#.....#.........#...#.#.#.# +#.#.###.###.#############.#.#.#.#.#####.#.#.#####.#.###########.###.#####.###.###.#.###.###.###.#.#.#.###.#.###.#.#.###.#########.###.#.#.#.# +#.#.......#...#...........#...#.#.......#.#...#...#.#.........#.........#...#...#.#...#.....#...#...#.#...#...#...#.#.......#.....#...#.....# +#.#####.#.###.#.#######.###.#.#.#######.#.###.###.#.#.#######.#.#######.#.#.#.#.#.###.#######.#####.#.#.###.#.#####.#######.#.#####.###.###.# +#.#.....#...#.......#...#...#.#.....#...#.........#.#.#.....#.#.......#.#...#...#.#...#...#.......#.#.#.#.......#.........#.#...#...#.....#.# +#.#.###.###.#####.#.#.###.#.#.#####.#.#.###.###.###.#.#.###.#.#.#####.#.#.#####.#.#.#####.#.#####.#.#.#.###.###.#.#######.#.###.#.###.#.#.### +#.#.#.#...#.......#.#.#...#.#.......#.#...#.#.#.....#.#...#...#.....#.#.#...#...#.#.#...#.....#.#.#.#.#.....#.#.#.......#.#.#.#.#.#.....#...# +#.#.#.#.#.###.###.###.#.###.###.#.#.#.###.#.#.###.###.###.###.#####.#.#####.#.###.#.#.#.#####.#.#.#.#.#######.#.#####.#.#.#.#.#.#.#.###.#.#.# +#.#...#.....#.#...#...#.#.#.#.#.#.#.#.#.#...#.....#...#.#.....#.....#.....#...#.#...#.#.....#...#.#...........#.......#.#.#...#.#.#.#.#.....# +#.#####.#.###.#####.#.#.#.#.#.#.#.#.#.#.#####.###.#.###.#####.#####.#####.#####.#####.#####.#####.#.###########.#######.#.###.#.#.#.#.#.#.#.# +#.#.....#.#...#...#...#.#.#.#...#.#.#...#.....#...#.#.....#.#.....#.....#...#.........#...#...#...#.......#.........#...#.#...#.#.....#.#.#.# +#.#.#####.#.###.#.#.#.#.#.#.###.#.#####.###.###.###.###.#.#.###.#.#.#####.#.#.#.#####.#.#.###.#.#.#######.#.#.#.#####.###.###.#.#######.#.#.# +#...#.....#.....#...#...#.....#.#.#...#.....#.#.....#...#.#.#.....#.#...#.#...#.........#...#.#.#...#...#...#.#.#...#...#...#.#.#.......#...# +#######.###########.#.#######.###.#.#.#######.#######.###.#.#.#######.#.#.#.###.#.###########.#.###.#.#.#####.###.#.###.###.#.#.#.#####.#.### +#.....#.......#...#.#...#...#.....#.#...........#.....#.....#.........#...#.....#.........#...#...#.#.#.....#.....#.........#.#.#.#...#.....# +#.###.#####.#.#.#.#.###.#.#.#####.#.#.#######.#.#.###.#.###.#############.###############.#.###.#.#.#####.#.#############.#.###.#.#.#.#.#.#.# +#...#.#.....#.#.#.#...#...#.#.....#.#...............#.#.............#.....................#...#.#.....#...#.........#...#.#.#...#...#...#.#.# +#.#.#.#.#.#.#.#.#.#######.#.#######.###############.#.#.###########.#######.#.###########.###.#.#.###.#.#.#####.###.###.#.###.###.#####.#.#.# +#.#.#.#.#.....#.#...........#.......#.#.....#.....#.#.#.......#...........#.#.#.....#.......#.#.#.#...#.#...#...#.......#.#...#...........#.# +###.#.#.###.###.###.#.#######.#######.#.###.#.###.###.#.#.#.#.###.#######.#.#.#.###.#######.#.#.#.#.###.###.#.#.#.#######.#.###.#####.#####.# +#...#.#.#.......#...#.........#.......#.#...#...#...#...#.#.#...#.#...#...#.#.#...#.......#...................#.#.#.......#...#.#...#.#...#.# +#.###.###.#.###.#####.###########.#.###.#.###.#.###.###.#.#.###.###.#.#.###.#####.#######.###.###.#.#####.#####.#.#.#####.#.#.###.#.###.#.#.# +#...#...#.....#.#.....#.........#.#.#...#.#...#...#.......#...#.....#.#...#.....#.....#.#...#...#.#...#...........#.....#.#.#...#.#.....#.#.# +#.#.###.#.#.#.###.###.#.#######.#.###.###.#.#####.#####.#####.#######.###.###.#.#####.#.###.###.#.#.#.#############.###.#.#.###.#.#######.#.# +#.#...#.#...#...#.#.#.........#.#.#...#...#.#.....#...#.#.....#...#...#...#...#...#...#...#.#...#...#.#...........#.#...#.....#.#.#.........# +#.###.#.###.###.#.#.#.#####.#.#.#.#.###.#####.#####.#.###.#####.#.#.###.###.###.#.#.###.#.#.#.#####.#.#.#########.###.###.#.###.#.########### +#...#.#.#.......#.#.#...#...#.#.#.#...#.......#...#.#...#.......#.#.#.......#...#.....................#...#.....#.#...#...#.....#...........# +###.#.#.#.#.#####.#.#.#.#.###.#.#.###.###.#####.#.#.###.#####.#####.#.#######.#.#.###.#.#.#.#.###.#.#.###.#####.#.#.#######.###########.###.# +#.#.#.#...#.......#.....#.#...#.#...#...#.#.....#.#.#...#.....#.....#...#.......#.#...#.#.#.#...#.#...#.#.#...#.....#.....#...#.......#.#...# +#.#.#.#####.#########.###.#.#.#.#.#####.###.#####.#.#.###.#####.#########.#####.#.#.###.#.#.###.#.#.###.#.#.#.#######.###.#.#.#.#####.###.### +#...#.#.....#...#...#.#.....................#...#.#.#.#...#.......................................#.#...#...#.#...#...#.#.....#.#...#...#...# +#.###.#.#####.#.#.#.#.#.###.#######.#.###.#.#.#.#.#.#.#.###.#####.#####.#.#.#.#.###.#.###.#######.#.#.#.#####.#.#.#.###.#####.#.#.#####.###.# +#S..#.........#...#.....#...........#...#.....#.#...#.....#...........#.....#.#.......#...........#...#.....#...#...............#...........# +############################################################################################################################################# diff --git a/y2024/src/bin/d16.rs b/y2024/src/bin/d16.rs new file mode 100644 index 0000000..7a9229b --- /dev/null +++ b/y2024/src/bin/d16.rs @@ -0,0 +1,27 @@ +use std::{fs, time::Instant}; + +use utils::time::get_elapsed_string; +use y2024::days::d16; + +fn main() { + let now = Instant::now(); + println!("Part 1:"); + part1(); + println!("Ran in {}", get_elapsed_string(now.elapsed())); + let now = Instant::now(); + println!("Part 2:"); + part2(); + println!("Ran in {}", get_elapsed_string(now.elapsed())); +} + +fn part1() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/16_input.txt")).unwrap(); + println!("{}", d16::process_part1(&content)); +} + +fn part2() { + let root = env!("CARGO_MANIFEST_DIR"); + let content = fs::read_to_string(format!("{root}/resources/16_input.txt")).unwrap(); + println!("{}", d16::process_part2(&content)); +} diff --git a/y2024/src/days/d16.rs b/y2024/src/days/d16.rs new file mode 100644 index 0000000..50a0fb0 --- /dev/null +++ b/y2024/src/days/d16.rs @@ -0,0 +1,64 @@ +pub fn process_part1(input: &str) -> i32 { + 0 +} + +pub fn process_part2(input: &str) -> i32 { + 0 +} + +#[cfg(test)] +mod tests { + use super::*; + + const INPUT_1: &str = "############### +#.......#....E# +#.#.###.#.###.# +#.....#.#...#.# +#.###.#####.#.# +#.#.#.......#.# +#.#.#####.###.# +#...........#.# +###.#.#####.#.# +#...#.....#.#.# +#.#.#.###.#.#.# +#.....#...#.#.# +#.###.#.#.#.#.# +#S..#.....#...# +###############"; + + const INPUT_2: &str = "################# +#...#...#...#..E# +#.#.#.#.#.#.#.#.# +#.#.#.#...#...#.# +#.#.#.#.###.#.#.# +#...#.#.#.....#.# +#.#.#.#.#.#####.# +#.#...#.#.#.....# +#.#.#####.#.###.# +#.#.#.......#...# +#.#.###.#####.### +#.#.#...#.....#.# +#.#.#.#####.###.# +#.#.#.........#.# +#.#.#.#########.# +#S#.............# +#################"; + + #[test] + fn part1_1() { + let result = process_part1(INPUT_1); + assert_eq!(result, 7036); + } + + #[test] + fn part1_2() { + let result = process_part1(INPUT_2); + assert_eq!(result, 11048); + } + + #[test] + fn part2() { + let result = process_part2(INPUT_1); + assert_eq!(result, 0); + } +} diff --git a/y2024/src/days/mod.rs b/y2024/src/days/mod.rs index 7e99654..74b0bb1 100644 --- a/y2024/src/days/mod.rs +++ b/y2024/src/days/mod.rs @@ -19,3 +19,5 @@ pub mod d13; pub mod d14; pub mod d15; + +pub mod d16;