]> aoc.elinar.fr Git - aoc_2024/commitdiff
Day16 - more test cases and still failing
authoralex <>
Mon, 16 Dec 2024 15:28:58 +0000 (16:28 +0100)
committeralex <>
Mon, 16 Dec 2024 15:33:22 +0000 (16:33 +0100)
Since the provided answer is wrong, try more test cases found in the
subreddit of the day.
Such test cases are passing. I can’t find the implementation error yet.

src/day16.rs

index fb9faccbf500889c9c57315d47d663ac8e7c55b7..111dee1b0ea6e01f0dbbc9d53abb7ba4563f925b 100644 (file)
@@ -167,11 +167,60 @@ mod tests {
 #.#.#.#########.#
 #S#.............#
 #################";
+    // from
+    // <https://old.reddit.com/r/adventofcode/comments/1hfhgl1/2024_day_16_part_1_alternate_test_case/>
+    static TEXT_INPUT_2: &str = "\
+###########################
+#######################..E#
+######################..#.#
+#####################..##.#
+####################..###.#
+###################..##...#
+##################..###.###
+#################..####...#
+################..#######.#
+###############..##.......#
+##############..###.#######
+#############..####.......#
+############..###########.#
+###########..##...........#
+##########..###.###########
+#########..####...........#
+########..###############.#
+#######..##...............#
+######..###.###############
+#####..####...............#
+####..###################.#
+###..##...................#
+##..###.###################
+#..####...................#
+#.#######################.#
+#S........................#
+###########################";
+    // same source
+    static TEXT_INPUT_3: &str = "\
+####################################################
+#......................................#..........E#
+#......................................#...........#
+#....................#.................#...........#
+#....................#.................#...........#
+#....................#.................#...........#
+#....................#.................#...........#
+#....................#.................#...........#
+#....................#.................#...........#
+#....................#.................#...........#
+#....................#.................#...........#
+#....................#.............................#
+#S...................#.............................#
+####################################################";
+
 
     #[test]
     fn test_part1() {
         assert_eq!(7036, run_part1(TEXT_INPUT_0).unwrap());
         assert_eq!(11048, run_part1(TEXT_INPUT_1).unwrap());
+        assert_eq!(21148, run_part1(TEXT_INPUT_2).unwrap());
+        assert_eq!(5078, run_part1(TEXT_INPUT_3).unwrap());
     }
 
     #[test]