Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Flashky committed Dec 19, 2024
2 parents 04e6728 + cf3d333 commit 2706f2c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<lombok.version>1.18.36</lombok.version>
<!-- Testing -->
<junit.jupiter.version>5.11.3</junit.jupiter.version>
<junit.jupiter.version>5.11.4</junit.jupiter.version>
<!-- Plugins -->
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
Expand Down
39 changes: 39 additions & 0 deletions src/test/java/com/adventofcode/flashk/day16/Day16Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,45 @@ public void testSolvePart2Debug2() {

// Read input file
char[][] inputs = Input.read2DCharArray(INPUT_FOLDER, "debug_edge_2.input");

// Source: https://www.reddit.com/r/adventofcode/comments/1hfhgl1/2024_day_16_part_1_alternate_test_case/

// ########################################################
// #.........#.........#.........#.........#.........#...O#
// #...OOOOOO#...OOOOOO#...OOOOOO#...OOOOOO#...OOOOOO#...O#
// #...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#
// #...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#
// #...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#
// #...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#...O#
// #...O#...OOOOOO#...OOOOOO#...OOOOOO#...OOOOOO#...OOOOOO#
// #OOOO#.........#.........#.........#.........#.........#
// ########################################################
//
// Camino inicial:
// 21 giros
// 110 pasos
// Coste total = 21100

// Tras ejecutar el algoritmo de la parte 2 debería quedarse así:
// ########################################################
// #.........#.........#.........#.........#.........#...O#
// #OOOOOOOOO#OOOOOOOOO#OOOOOOOOO#OOOOOOOOO#OOOOOOOOO#...O#
// #OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#...O#
// #OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#...O#
// #OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#...O#
// #OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#OOOO#...O#
// #OOOO#OOOOOOOOO#OOOOOOOOO#OOOOOOOOO#OOOOOOOOO#OOOOOOOOO#
// #OOOO#.........#.........#.........#.........#.........#
// ########################################################
//
// 28 círculos caja izquierda
// 216 círculos caja centrales
// 10 círculos verticales
// 10 círculos en la última caja
//
// Total = 264
// Cualquiera de los caminos óptimos tendría un coste de: 21110

ReindeerMaze reindeerMaze = new ReindeerMaze(inputs);

assertEquals(264L,reindeerMaze.solveB());
Expand Down

0 comments on commit 2706f2c

Please sign in to comment.