diff --git a/01/go.mod b/01/go.mod deleted file mode 100644 index cbf6afd..0000000 --- a/01/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module git.z1glr.de/advent-of-code-2025/01 - -go 1.25.4 diff --git a/02/go.mod b/02/go.mod deleted file mode 100644 index 88ca325..0000000 --- a/02/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module git.z1glr.de/z1glr/advent-of-code-2025/02 - -go 1.25.4 diff --git a/03/go.mod b/03/go.mod deleted file mode 100644 index 7009967..0000000 --- a/03/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module git.z1glr.de/advent-of-code-2025/03 - -go 1.25.4 diff --git a/04/input b/04/input new file mode 100644 index 0000000..37862cb --- /dev/null +++ b/04/input @@ -0,0 +1,135 @@ +.@.@@@@@@.@@.@@@..@@.@@.@@@@.@@@@@@..@.@@@..@.@.@@@@@@..@@@@@@@.@..@.@..@@@@...@.@@@@@@.@.@@@..@@.@@..@@.@.@@....@@@@.@@@.@.@@.@@..@..@ +.@@...@@@..@@@...@.@.@..@..@.@@@..@.@@@@@@..@.@@..@@@.@@@@..@@@.@@@@@@@.@@@.@.@@@.@@@@.@@@@.@...@.@.@@@.@..@@.@.@@@@.@@@@@@@..@...@@@.@ +@@@@@.@@@@.@@@..@.@@@.@@@@.@..@@@@@.@@@@.@@..@@@@@@@@@@@@..@...@.@@@@@@@@@.@@.@...@@..@@@@@@.@.@@@@@.@..@@@.@@@@.@@@@@@.....@.@@@@@@..@ +.@@@..@.@.@@.@@@@@..@@@@@@.@.@.@.@.@@@@@..@..@..@..@@@.@@@@@@@@.@.@@.@@@.@@@@.@..@@.@.@@.@@..@.@@.@.@...@@.@@@@..@.@@@@@@@@.@@@@@.@@@@@ +@@@.@.@..@@.@.@.@@@@@@.@.@.@.@@@.@@@@..@.@@@.@@.@.@@@@.@....@@@.@@@@.@@.@@.@@.@@@@.@@@..@@@@@@@@.@@@@...@.@@@@@@@@@.@@...@.@..@@@@.@@.@ +@@.@@.@.@.@.@..@@@...@@.@@.@@@@@@@@..@..@@@@@@...@.@@@.@.@@@.@....@@@@@.@@@@@@.@@@.@@.@.@.@@..@@..@.@@@.@@...@@@@.@@.@@..@@@@.@@@@.@@@@ +@@@.@@@@@@@..@@@.@@.@@@@..@.@@.@@@.@....@@@.@..@@@@@.@@@.@@..@..@@@@.@.@.@@@@.@@@@....@@@@@@@@@@@..@@.@@.@.@@.@@@@@@.@@.@@..@.@...@@... +@@@@@@@.@@.@@@.@.@@@.@@@@@@@@@@@..@@@..@@@.@@@@@@@.@...@@@@.@@@.@@@@@@@@.@.@@@.@@@@@.@@@@.@.@@@@@@@.@@@@@...@.@@@@.@.@.@@@@@@@..@....@@ +@@@@.@@@.@.@@@@@.@.@@..@.@@....@.@@@@.@.@..@@@@@.@@.@..@.@@..@@.@.@@@@@.@.@@@@@@@@@@@@@@@@.@@@@@@@@.@.@.@@@@.@@@@.@.@@@.@@@@.@@...@.@@@ +@@@....@...@@@.@@@...@.@@@@.@.@@..@@@@.@.@.@@@...@@.@@.@@.@@.@..@@.@...@..@.@.@@@@@@@.@@.@@@.@.@.@@@@@@.@@@@.@.@@@.@.@@@.@@@@@.@@@@@@@@ +.@@@@@@@@@@.@@@@@@@.@@@@@@......@@@@.@.@@@@@@@.@@.@@.@@@..@@@@@@@@@@@@.@@@.@.@...@.@@@@@@@@.@.@@.@..@@@@...@@@@.@.@@@..@..@@@.@@@@.@.@. +.@@@.@..@@@...@@.@..@.@@@....@@@@@.@@@@@.@@@@.@.@..@..@...@.@.@@@..@@@.@@..@@@@@@....@@.@@@@@@..@.@@.@@....@@.@.@.@@@.@@.@@.@@@@@@@.@@. +@...@@..@@.@...@@@.@@@...@@...@@@..@@@.@.@.@@.@.@@@@..@@@@.@.@@.@@.@..@.@@@@@@.@@@@.@@..@@@.@@@.@@.@@@@..@@...@@@@@@@@.@@@..@.@@.@@@@.. +@@.@.@@@.@@..@@....@.@@.@@.@@.@...@@.@@...@@@@.@@@.@..@@@@@@..@@...@@@..@@@@@..@@@@@@...@.@@@@.@.@@@....@..@.@.@@@.@.@.@@@@@@@@.@@@.@.@ +@..@@@@@@....@@@@.@@.@@@.@@..@@@@.....@@@@@@@.@..@@@@.@@@@@@@@@.@@@@@...@@...@@@@@..@...@.@..@@@......@@@@.@@.@@@..@@...@@@.@@@@@.@@.@. +@.@@@..@...@@@.@@@@@@@@..@@@@..@@.@@@@@@@@@@..@@......@@..@@.@..@.@@@....@@@@@@.@@@@..@@.@@.@@.@@.@.@@@.@@@@.@@.@@.@@@@..@.@@@.@@.@@.@. +.@@@..@@@..@@..@@.@@@@...@@@.@@...@@@.@.@.@@@@@@.@@.@.@...@@@@@@.@..@@..@@@@@@@@.@@.@@@@...@@..@@@@@@.@@.@@@@@.@.@.@@@@@..@@@@.@@.@@@.@ +@.@@.@@@...@.@@.@@.@..@@...@@.@@@@@@@.@@@@.@.@@.@..@@.@@.@.@@@....@@@@@..@@.@..@@@@....@@@@..@@.@.@@..@@@@@@@@@@@@..@@.@@.@@@.@.@.@.@.. +@.@@@@.@@.@@@@@@@@@...@@@@...@@..@@@@@.@.@@..@@..@@@..@@@@.@@.@.@@@.@@.@@@@.@.@...@@@@.@@.@@.@@@.@@@@@@.@@.@...@..@@@.@@@@.@..@@.@@@@@. +..@.@...@@@@@@@@@.@@@@.@@.@..@@.@.@@.@..@@@@..@.@.@@@..@...@@@@..@@@@@@.@@.@@@@...@@@...@.@.@@@@@@.@.@@.@@@.@@@@@@@@@@@@@@....@.@@.@@@@ +@@.@@.@..@@@@.@.@@@.@.@..@@@@...@.@@@@@.@..@@.@@...@@@@@@@@@.@@@@@@@@@.@.@@@@.@.@..@@@@@@.@.@@@@@@@.@@@@@@@@@@@@@.@@@@@@@.@.@@@@@.@..@. +@@.@@@@@@@@@..@..@@.@.@.@@@@@.@..@@@@@@@@@@.@@@.@@@.@@.@@@...@..@@@.@@@@..@@..@.@@...@.@.@@@@@@@.@.@..@@@@.@@@@@@@@@@.@.@@@@@..@@.@@.@@ +.@.@@@@.@..@...@..@@@.@@@@@.@..@@.@.@@.@@...@@...@....@@@...@@@@@@..@..@@@@@@@@@@.@@.@...@@..@.@.@@@@@.@@@@@....@..@@@.@@@@..@.@.@@@.@@ +@@.@@.@...@@@@@@@@.@..@@..@@@..@@@.@.@@.@@@@@.@.@@..@@@@@@@.@@@.@@@@@@@...@@@@@..@@@@.@@@...@.@@@.@@@@@@@.@@...@@@@.@.@@@..@@@@@.@@.@@@ +..@@@@@@@.@@@@.@.@@@@@@@..@..@@@@..@...@.@@.@.@@@@..@.@@.@...@@..@@@@@..@@....@.@@.@@..@@@.@..@..@..@.@@.@@.@.@@..@@@.@@@@.@.@.@.@@@@@. +.@......@@@@@@@@@@@@@@@@......@@.@@@@@@.@@.@@.@@@@@@@.@@@@@..@.@@@.@.@..@@@@@@@.@@@@@@@.@..@@@.@@.@..@@@.@@@@@@.@..@..@@...@.@.@@@@.@@@ +@@@@.@@.@@@.@@@...@@.@@@..@.@@@@@@@.@..@@@.@@@.@@.@@@@.@@.@.@@@..@..@.@.@....@@...@@@@@.@@..@.@@..@.@@@@@.@....@@@@@@@@@.@..@@@@@@@@@@@ +@@...@.@.@@@@@@.@....@@@@..@.@@@@@@@.@..@@.@@@@...@@@@.@@.....@@@@@@.@@@@@@@...@@@@.@@@@@@.@@@.@...@@@..@@@@@@@.@@@@@@@.@..@@.@@@@.@@@@ +.@@.@..@@@..@.@@@@...@.@@@@@..@..@.@.@@.@@@@@.@.@@.@.@.@@..@@@@@..@@@@..@@...@@@@.@@@@@@.@@..@@@..@@@@@@@@@@...@@@@@@@@.@@@@@@@.@@@@.@@ +@@@.@@@@@.@@@@@@@.@@@@@@...@.@@@@@@@@@.@@@@.@@@.@@.@....@@..@..@...@@@@@@@@@@@.@@@...@@@..@@.@@.@@.@@.@@...@@..@@.@@@@@..@@@@@@@.@.@@@@ +@.@.@.@@@@.@@@@@@@@@@......@.@.@@@@@@.@@@@@@@@@...@.@@.....@@@@@@@@@.@@.@@@@@@.@..@@@.@@@@....@@@.@@@.@.@@@.@@.....@@@@@.@..@@.@@..@@@@ +@.@@@@@@@@@..@..@@@@.@@@@.@......@.@@.@@..@..@.@@@.@.@..@@@@.@@.@.@@.@.@@@@.@..@@@@@@@.@@@.@@@@..@.@@@@@@...@@@.@..@@..@@.@.@@@.@...@.@ +.@@@.@@@@@@@@....@.@.@@.@@@@@@@@@@@@@@@@@@@..@.@@@.@.@@.@@.@..@@.@..@@.@..@@@@.@@@.@@@@@@@@.@@@@@.@..@@@.@.@@..@@@@..@@.@@@@@@...@@@..@ +..@@@..@@.@.@@.@..@.@@..@@@@..@@@..@@@..@...@@@@.@@..@@@.@.@@@.@.@@@.@...@@.@@..@@@@@@.@@@.@@@@@@@...@@....@.@.@@...@@@@@.@@.@@@...@@@@ +@@@@..@@@@.@@@@.@@@@@@@@.......@.@.@.@.@@@@@@@@@@@@@@@.@@@@..@@@@.@@@@@@@@@@@@.@.@.@@@@.@@@@@@@@@@@.@.@@..@@..@@@.@@@.@@@.@@.@@@@@@.@@@ +...@..@.@.@@.@.@@@@@@@@.@.@@..@@@@@.@@....@@@.@......@@@..@@.@.@..@@@@.@..@@@.@@@@@@@@@....@.@.@@.@@@@.@@@@@@@...@@.@@.@@@@..@@@@@...@@ +@@@.@@@.@@.@@.@..@@@.@@@.@@.@.@@@@.@@..@@@@@.@@.@@@@.@@.@.@....@@@...@.@@@@@@@@@@@.@@..@@@@@@.@.@@@..@.@@.@@@@@@@.@.@@@@@.@.@@@@@.@@.@. +..@.@@@..@..@.@...@@@@@@@@@@@...@.....@@@@.@@.@@..@@@@@..@@.@@@.@@@@@@@.@@@...@.@@@.@@@@.@@@@@..@@@@@.@.@@@@...@@@@..@.@@.....@..@.@.@. +@@@@@@@@.@.@.@.@@.@@.@@@@@@@..@....@@@.@@@..@@...@@@@@.@@@...@@@@@..@@..@.@@..@.@@@@@@@..@@.@@.@..@.@@@@.@@@@@@@.@.@@@@.@..@@.@@@@@.@@. +@@.@@@.@...@@.@@.@@.@@@@@@@......@@.@.@@.@@.@@.@...@.@@@..@@@@@.@.@@@..@@@@.@@@..@@@@.@.@@@..@@@@.@@@@@@@@@@.@@@@@@@@@@@..@@@..@.@@@..@ +@@@.@@...@.@@@@.@@.@@.@@.@@.@@..@.@@@@@@@....@@@..@@..@.@.@@@@@..@@.@..@.@@@@@.@.@@@..@@@@@@@@.@....@@@..@@.@@@.@.@.@.@@@@.@@@.@@@.@.@. +@@.@@@.@.@@@..@@@@.@@@..@.@@@@@@@@@.@@@@.@@.@@..@@.@.@@@.@.@.@@.@@..@.@@.@@@@@@@@@.@.@@@..@.@@@@@.@.@@@..@..@@@@@@@@@@@@.@.@@@@.@..@@.@ +@@@@@@@@@..@@.@@....@.@.@@@.@@.@@.@@@..@@@@.@@@@@.@.@@@.@@@@@.@@.@@.@.@...@@...@@@@@@@.@@@@@@@@@@@.@..@@.@@@...@@@@@@@.@@@@@@@@........ +@..@@@.@@@@....@.@@@..@@@@.@@.....@@....@.@...@...@@@@@..@....@.@.@@@@@..@@@@@@@..@..@@..@@@@.@@@.@@.@@@.@@@@@@..@.@.@@@.@@@@...@.@@..@ +@@@@@@.@..@.@.@@@@@@@@.@@@@@.@@.@@@.@.@@@@@.@.@...@.@@@.@@@@@@.@@@@@.@@@@...@@.@@@.@@@.@@@@.@@@.@.@@..@@@@.@@..@..@.@..@@@@@@@@....@@@@ +@@@.@@.@@@......@@@@..@..@@@.@@.@.@@..@.@@....@@.@@.@@@..@.@.@...@@.@@@@@@@@......@.@@@@@@@@@....@.@....@@@@.@.@..@.@@.@@..@.@@@.@@@@.. +@.@@@@...@.@@.@.@..@@@@....@@@@@@@@@@....@@@@.@...@@..@@@@@@@.@@@.@@....@@@...@.@@..@@.@@@@@@..@..@@@@@@@....@@@@@.@@..@...@@..@.@@@@.. +@.@@@.@@@@.@@@@.@@@@@..@.@@..@..@.@..@.@@@@@@@.@@@@@@..@@@.@..@@@.@@..@@@@@@@@.@@@@@@.@.@@@@@@@@.@..@@@@.@@@.@@.@@@@@@@@@@@.@@@@@@@@@.. +@@@.@@.@@@@....@@@@.@@@.@@......@@@@..@.@@@@@.@@.@.@@@@@@@@@.....@@@@@.@@..@..@@....@@.@@@.@@.@.@@@@@@@@@@@@@.@.@@@@..@.@..@@.@@.@@@@@. +@@@@@..@@.@..@@@@@@@@@@.@@.@@.@@..@@@@@@..@@@.@@@@@@@.@..@@.@@@.@@@@@@@@@@@.@@.@@@@...@@@@.@.@.@@@@@.@.@@...@@.@@@@@@@.@@@@@@.@...@@@@@ +@@.@@@@@..@@.@@.@@@@@@..@.@@@..@@.@@@.@@@..@@@@..@@.@..@@.@.@..@.@.@@@@@...@@@.@@@@@..@.@@@.@@.@...@@@@@.@@@..@@@@.@@..@..@@@.....@..@. +@@.....@.@@@..@@@@@@..@@@...@.@@@..@...@.@@@@..@@@@..@.@@.@.@.@@@@@.@@.@@@.@.@@.@@...@@.@...@@@.@@@@.@@@@@@.@@@@.@.@@.@@.@..@@@...@.@@. +@.@@@.@.@@@@.@@@@.@@..@@@@@@.@@.@@@.@.@@@.@@.@.@.@@@.@@@........@@..@.@@.@@@....@@@@@.@.@@.@.@@..@@..@..@@@@@@@@...@@.@.@@@...@@@@@@@@@ +.@@@@@.@@@@@.....@@@@@..@@@.@@@.@...@@..@@@@@.@.@@.@@@@@@@..@@.@@@@.@@...@.@.@@.@..@@..@@@@@.@.@@@.@.@@@@@@@.....@..@@@@.@@....@@...@.. +@@..@@.@..@@@@@@@@@.@.@@.@..@..@@@..@@...@.@.@@@@.@..@.@@..@.@.@@@@.@@.@@.@@..@@@.@..@.@.@@@@@@@@@@@@@..@@.@@@...@@.@@@@@...@.@@@.@@.@. +@.@.@@.@@......@.@@@@@@@@@.@.@@.@@@.@..@...@@@@.@.@.@@.@@.@@.@.@@@@@@@.@..@@@@@@@.@..@@@@.@@@@.@@@@@@@.@.@@@@@..@@@@...@@@..@.@@.@@@@@. +@@@@.@@@..@@@.@@.@@@@@@.@..@@@@.@@@.@.@@@@@@@@....@@@@@.@@@@.@@@.@@@..@.@@@.@@@....@@@@@...@....@@@@.@..@@@@.@@@@@...@@.@@@.@@.@@@@.@@@ +@@@@.@@..@@.@@..@.@@@@.@.@@@@@@@.@@.@@@@@@@@....@@@@@.@@@@@@@@@@.@@...@.@@@@.@@.@..@@@.@@.@@.@@..@.@@.@@..@.@@@@@.@@.@@@@@@..@.@@..@@.. +@@.@@@@.@...@@@.@@@.@@@@.@@.@@@@@@@...@.@@@.@.@..@@@.@@@@...@@@@@@.@@@@@@.@@.@@.@@@@@.@..@.@@@.@.@@@.@.@@..@@@.@@..@@@@.@@@..@@@@.@@.@@ +@@@@@.@....@...@@...@.@..@.@@@@.@@@@..@@.@@..@@.@.@@@@@@@@..@.@@.@@@@@.@@.@@@..@@@@.@.@@@@...@.@@.....@@@@.@@@@.@@@@@..@@@..@@@.@@@@... +@@@.....@@@@@@@@...@@@.@.@..@@@@@..@.@@@@@.@...@@@@@@.@@@.@@.@@@@@@@@@.@@@@@@@@.@@@@.@...@.@@@@@..@.@.@@.@@@@@@.@@..@@@..@.@@...@@..@.@ +.@@@.@@.@.@@@@@@....@.@@.@..@@@...@@.@..@...@@@.@.....@.@.@@@@@.@@.@@@@....@....@@..@..@@.@@@@@@@...@@@@@@@..@@@@@@@@@@@@@@@@@@@@@@@@@. +@@@@.@.@@@@..@@@@..@@@@@@.@@@@@@.@@.@@@@@@..@@...@@.@@@@@@@@.@@@...@@.@.@@@.@.@.@@@.@@@.@@.@..@@@.@@@.@.@@@@@.@@@@@@@@@@@@@@...@@..@@@@ +.@@.@.@@@@@@..@.@@@@@@@@@@@.@....@@@.@..@.@@@@.@@.@@@@@@@@@@@.@.@@.@.@@@.@@@.@@@@@@...@.@@@.@@@@@@@@.@@@@..@@@.@@@..@@@.@@@.@@@@@.@@.@@ +..@@.@@....@@..@.@@.@@......@.@..@...@..@@...@@@..@@.@@@@@@@..@.@.@@@@@.@@@....@@@@@.@@.@@@@.@@@@@@@..@@@..@@@.@@.@@@...@.@@@@.@.@..@@. +@@@@.@@@@.@@@@@.@.@.@@@.@@@@@..@.@@@...@@.@@@@@@.@.@@.@@@.@@@@@..@@@@@@@@@@@@.@@@@@@@@@@@.@...@@.@.@..@@@@@.@@.@@@@@@@@@@@.@.@.@.@@@..@ +.@.@...@@@@@@.@@@@.@.@..@@.@@@@@@@...@...@.@.@..@@.@.@@@.@@@.@..@.@..@@@@@@@@@@@..@@@..@@..@@...@.@@..@..@@@@@@@@@@@@@.@.@@.......@@@@@ +.@@@..@@@@@@.@.@@@.@.@@@@@.@@@@.@..@@@@@..@@@@@.@@@@@@@@@.@..@@.@@@.@@@.@@@@..@..@@@@.@@@@@@.@.@@@@@@.@@@...@@@@@.@.@@@@.@@@@@@@@@@@..@ +..@......@.@.@@.@@@@@.@@@@@...@@@..@..@@@..@@...@..@@@..@@..@@.@@.@@@@@...@.@@.@@@@..@@.@.@@@@@@@@@@@.@@@@..@@@@.@.@.@@@@.@.@@.@.@..@.@ +.@@@@@@@@@@@@.@..@.@@@@@.@@@.@@@@.@..@@@@@@@@....@@@@@@@@.@.@@@@.@.@@.@@.@@.@@@....@@@@.@@@.@.@...@...@.@@@..@@@@..@@.@.@..@@@@.@@.@@@. +...@.@@@.@..@@.@@@@@@@..@@..@@.@@.@.@@@@@..@@@..@@.@@.@@@.@@@@....@@@@@@@@@@..@@@.@@..@.@@@@.@......@.@@@.@@.@@.@@@@@@@@@@@.........@.. +..@@@.@..@...@@@@...@.@@.@@@@@@@@@@@@@.@@@@@@@@@@@@.@.@@@@@@..@.@.@@@@@@@.@@.@@@@.@@@..@.@@@@@@.@@@...@@@@@@@.@.@@@@.@..@@@@.@@..@.@@@. +.@.@@.@.@@@..@.@@@@@@@@@.@@.@.@@@@.@.@..@@.@@..@@@.@@.@..@@.@@@@..@.@@@@@.@.@@@..@.@@@@@.@.@@.@@.@@.@@@.@@@.@.@@..@..@@...@.@@.@.@..@@@ +@...@@.@@@@@@@@.@.@.@.@...@@@@@@.@.@@@.@.@@.@@@@@@@@@@@@@@@@@@@.@..@.@.@@@@..@.@@.@..@@@..@@.@@@.@@.@..@@...@@@@.@@.@@@@.@@@@@@@.@@@@.. +.@@@...@@@.@.@@.@@@@@@@@@@.@.@@.@@.@@.@@.@...@@.@@@.@@.@..@.@...@@@@@@@@@@@@@.@@@.@.@.@@@@@@.@@@@.@@@@@.@@.@.@@..@@..@.@.@@.@@.@@.@..@@ +@.@..@.@@.@.@@.@@..@.@...@@@.@.@.@@.@@@@@.@@@@@..@@@..@@@@@@.@..@@..@..@@@@@@@@@.@@.@@..@@@@@.@@@..@@.@..@@@@@.....@@..@@@@.@.@@@@@@@@@ +@@@@@@..@...@@@.@@..@.@...@@@@@..@@.@.@.@@...@.@...@@.@@.@@@@@@@@@@...@@..@.@..@@......@@@@.@@@..@@@@@.@@@@@@.@.@@@@@@.@.@.@@.@@@@@@.@@ +@@..@@.@@@.@...@..@@@@.@@.@.@@...@@@@.@@.@.@.@@@@@@@@@@@@@.@..@@.@@@....@.@.@.@.@.@@@..@@@@.@@.@..@@@@@@@.@@@@.@@@..@@@@.@@@@@..@@@@@@@ +.@.@.@@@@@@@@@@..@..@@@@@.@.@..@.@@@@@@.@@@@@.@@@.@@..@@.@@@@@@@@@.@.@@@@...@@@.@@@@@@@.@@@@.@@@.@...@..@.@.@@@@@@..@.@@.@@@@.@.@...@@@ +@@.@@@@@..@@@@@.@@@@@.@@@.@@@@.@@.@..@.@.@@@@..@.@@.@@.@@@@@@....@@@@@@@...@.@@.@@@.@@@.@@@@..@@..@..@@..@..@@.@.@@@@@@@.@...@@@@..@@.@ +.@@@.@.@@..@@.@...@@@.@@@@.@@@@@.@@.@@@@@.@@.@.@.@.@@@@@@@@.@@.@..@@.@.@.@@.@.@@@@@@.@@.@@.@.@@@..@@@@.@.@@@@@.@@@@@@.@..@@@..@@....@.@ +@@@@@@@@@@.@@@@.@..@@..@.@@..@@@.@@@@@@.@@.@..@..@.@@@@@@.@@@@.@@@@..@..@@..@.@@@@.@@...@@@@@.@.@.@@@.@..@@.@@.@...@@@@@.@@.@@@@..@@@.@ +.@.@.@@@@@.@@@...@.@.@@..@@@@@@@@@.@.@@@@.@@@.@@.@@@.@.@...@@.@...@.@@@@@@@.@@.@@.@@@@@...@.@@.....@@@.@@@@..@....@@....@@@@.@..@@@.@.@ +...@@@.@.@@@.@@.@@..@..@@...@.@.@@@@@@@@@.@@.@@@@@@@..@@.@.@@@.@@.@@@..@@@@@@.@...@@@@.@@.@@@@@.@@@@.@.@@.@@@@.@.@@.@..@@.@.@@..@@.@@.@ +.@@...@@@.@@.@@.@.@.@.@@@@@..@@@.@@@@@@@@@.@@@@@@@@..@@......@..@@.@@...@@@.@@@@@.@..@..@@.@@.@.@..@@...@@.@@@@.@@.@@@@....@@@.@@@@...@ +@@@.@@.@@@.@.@.@@@@@@.@.@@@.@.@@@...@@@@.@....@.@.@@@@@@.@@.@@@.@..@@@@@@...@@@@@@@@@@...@.@@@@@.@.@..@@.@.@@@@@..@@@@@@@@@@...@@@@.@.@ +@@@@@@@@.@@@@@@@@.@..@@@@.@@.@@@.@@@@.@@.@...@.@.@@@@@@..@@.@..@@@...@.@..@@@.@@@@@@@@.@.@@@.@@@.@.@@@.@.@@...@@.@@@@@@@@..@...@@.@.... +@@@@.@.......@@@@.@@@...@@.@@...@@..@.@.@@...@@@.@@@@@@@..@@@@..@@@.@@@..@@@@@@@@.@.@..@.@.@@@@@.@.@@@@@.@.@.@@@..@...@@@@@..@@@..@@.@. +.@@@..@@...@@@@@@.@....@@@@@.@@@@@..@@@@@..@@.@@@.@@@.@@.@.@....@@.@@@.@@......@@@@@.@.@@.@..@@@@@@@@@.@.@@.@@@.@@.@@@.@@..@@@.@@.@@@@. +@@@@@@@@@@@...@@..@@@@@@@@.@.@@.@@@..@..@...@...@@....@.@@..@@.@@@@@@@.@@..@.@@.@..@@@.@@@@@@@@@@@@.@@@@@@@...@@.@@@@.@@..@.@..@@@@@.@@ +.@@@.@@..@@..@.@@..@..@.@....@.@.@@@@..@@@@.@@@.@...@@..@@@@@@....@@@.@.@@@@@@.@..@@@@@@..@@.@..@@@@@@@.@@@.@@@@.@.@@@.@.@@.@.@.@@@.@@@ +@.@@@@..@@@@@..@@@@@@@.@@@@@@..@@@@@.@..@@@.@@@@..@.@@@@@@..@.@@.@@@.@@@.@..@@@@@@@.@@.@@@@@.@@@@@.@..@@@@@@@@@@.@.@@@@@@@@@@.@@.@@@@@. +@@@.@@@@@..@@@@@@@.@@@@..@@@@@@@@..@.@@.@@.@...@@.@@..@@..@..@@@@@@@.@@@..@@@@@@.@@.@@@@@@@@.@..@@.@@.@@@@@@@.@@@@@@.@@@@@.@@.@@.....@. +@@.@.@@.@@@@..@@@@@..@@.@.@@@...@@@@@@...@.@@.@.@.@@@@@@@@@@@@.@@@@@@@..@@@@..@@.@@@.@@@@.@@@@@@@@@@@.@.@@.@@@@@@@@.@@.@.@@@@@@..@...@@ +..@@@...@..@.@@..@@@...@@@..@@@@@@@@@.@.@.@@.@.@@@@@@.@.@.@@@@.@@@@@@...@@@@....@..@...@@..@@@@@@@@...@@..@.@.@@@.@@.@..@@@@@@..@.@.@@@ +@..@..@.@.@@@..@@@.@...@.@@@@.@.@@@@@@@@@@@.@@.@.@@@@..@@.@.@@@@...@.@@..@@..@@@.@@@.@@@.@@@@@@@@@@@@@@.@.@.@@@.@..@.@@@@.@@@.@@...@.@. +..@.@@@.@@@@@@.@@.@@@....@.@@@@.@...@@@.@..@@@@.@@@@....@.@@.@.@@.@@@..@@@.@@@@@.@.@.@@@.@@@@@.@@.@@..@@.@@@..@@@@.@..@@.@@.@..@@@@@.@. +@..@..@.@.@.@@.@.@.@...@@@@@.@@@@@..@.....@.@@@.@@.@@@@..@@@@.@@.@@@.@@@@..@..@@.@@@..@.@@.@.@.@...@@@@.@@@@.@@..@..@...@.@...@@@@@@@.. +@@@@@.@@@..@.@@.@.@@@@@@@@....@..@@.@@..@@@@.@..@@@@@@.@@@@@@.@@.@@@..@.@..@.@@..@@@.@..@..@@..@.@@@@.@@....@@..@@@...@.@@.@@@@.@.@@.@@ +..@.@@@@..@@..@@.@.@@@..@@..@@@@.@@@.@@@@@@@@.@@@...@@@@...@..@@@@@@...@.@.@@@.@@.@@@..@@@@.@@@.@@@@@..@@@@@.@@@.@@.@@....@@.@@@@.@@@.@ +.@@@@@@@@@....@.@@@@@.@@@.@@..@@@.@@@.@@.@@.@@....@@@.@.@@.@@@.@@@@.@.@@@.@@@@@@@@.@..@@@@@@@@....@.@@@@.@@...@@.@@@.@@.@.@@@.@@..@.@.@ +@@@@..@@@@@.@@@..@@@.@@..@.@@.@@.....@@.@..@...@@@....@..@.@@@@.@@.@...@@.@@.@@..@@..@.@.@@@@@...@@@@.......@@@@..@@@.@@..@@@.@.@...@@@ +@@@.@@@.@@@@@@@@.@@.@@.@.@@@..@@@.@@@.@.@..@@@@..@.@@@@@@..@..@.@.@@.@.@.@@@@@@@.@@@@@@@@@..@@@...@@@@.@@@.@.@@..@.....@@.@@@.@@..@.@@. +@@@@@@@@..@@@@@@@@@.@@.@@@.@.@.@.@@.@@@@@@@@@@@@@@@.@@@.@@@@.@@.@@@@.@..@.@@.@.@..@@@.@@@.@@@@.@@@.@@..@@@@@@@@@@.@@@@@..@@@@@@@@@@@.@. +@@@@.@.@.@@@@.@@@@.@@.@..@@@..@...@..@@@.@@@@@@.@..@@@....@@@.@@@...@@.@@..@@.@@..@@@@@@..@@.@@.@@@@@@.@@.@@@@@@@@.@@.@@@@.@.@..@@@@@.@ +.@.@@@.@@....@@@.@@@.@@@@@@.@@@@@@.@@@@@@@.@@@@.@..@@@.@@....@@@...@@@@.@@@.@@.@.@@@@.@@@@..@.@.@@..@@@@@@...@@@@@..@@.@@.@...@@@.@@@@. +@@@@.@..@@@@@@@@@.@..@@...@@@@@..@@.@@@@...@@@@..@@@.@@@@.@.@@@@@@.@@.@.@.@.@@@@@@@.@@@...@.@@..@@@@@@@@@..@...@@@@@.@.@@@@.@@@.@.@.@@. +@@@@@@@@@@@@@....@.@@..@@@@@.@.@.@.@.@@@@..@...@..@@..@.@@@@@@...@.@@.@@..@@.@..@@..@@@@@@@@.@@@.@@@@@@@@.@@@@@@@@@@.@@.@@...@.@@.@@.@. +.@@@@..@@..@@@@@@@.@.@@..@@..@@.@@@@@.@@@@@.@@...@@@.@...@@.@@@@@@@@.@@.@@@..@.@@..@@.@..@@@..@..@...@@.@@@@@.@.@..@@.@.@@@..@@@...@... +.@@@..@.@.@.@@.@@@@@@.@..@@@@@@@@@@@@@.@@..@@@...@@.@@@@.@.@@@@..@.@.@.@@.@@@@@@...@@@@.@@@@@.@@@@@@.@@@@@@.@...@@...@@@@..@@.@..@@@@.@ +@.@.@@..@@@@@@.@.@@@.@...@@..@@.@.@@@@@.@@@...@.@@@.@.@@@@@@@.@@..@.@@@@@.@@@@@@@@@@@@..@@.@@.@@@.@...@@@@@@@.@@@@.@@.@@@@.@@@@@@@@@..@ +@@.@@.@.@@@@@@..@@@@@@@@.@@..@@@@@@@.@@..@@.@.@@@@.@@@.@@...@@......@@@@@@@@@@@.@.@@@.@..@.@@@.@@.@.@..@@@@@@@@.@@.@@@..@.@@@@.@@@@@@.. +@@@@@@.@@.@.@@@@..@.@@@@@.@@@.@@..@@@@@..@@.@.@@@..@@.@@.@@@@@@@@@@@@@@@.@@.@@@@@@@@.@..@@@@@.@..@....@.@@..@@.@@@@@@.@@@@@@@@@@@@@@@@@ +.@@@.@@@@@@.@.@@@..@@@@..@@@@@@@....@@@@.@@@..@@....@@@@@@.@@@@@.@@@.@@.@.@@@.@@@.@@.@@@@@@@.@@.@@..@@@...@@.@@@@@@@.@..@@.@@@@@@.@@@.@ +@..@@..@@@@@@@.....@@.@@@@@@@..@@@@.@.@@@@@...@...@@..@..@@@.@@@..@..@@@@@@.@@@..@@@.@.@@@@....@.....@@@.@..@.@@.@@@@.@.@@@.@@...@@.@@@ +@.@@@@@@@@.@..@.@@@@@.@@@@@@..@@@@@.@.@@@@@@@.@@@@.@@@.@@@@@@@@@@@.@..@@.@@@@@@.@@@...@@@@.@@.@@@.@@@@@.@.@@@@@@@@@@.@@@@...@@@@...@..@ +@.@.@.@@.@@@.@..@...@@@@.@@@@@@@.@@@@@...@..@...@@.@@@@@..@@@.@@..@@@.@@@.@@@@@.@.@.@.@@.@.@@@...@@@@@.@@.@@.@.@.@.@..@@..@..@@..@.@@@@ +.@@@@..@.@.@@@@@.@.@..@@.@.@@.@@@@@@.@@.@@@.@@@...@@.@@@@@@@@..@@@@.@@@.@@@.@@@@@@....@@@.@@.@@@@@@@.@@@@@@@.@@.@...@@@@.@@@..@.@.@@@@@ +.....@.@@@@@@..@.@@@.@@.@@@@@.@.@@@.@@@...@@..@@@.@@@@@@.@....@@@.@@.@@@.@..@...@.@@@@@@.@.@.....@.@..@.@@.@.@.@....@..@@@@@.@@@@@@.@@@ +@.@@@@@.@@@.@@.@.@..@@@.@@@@..@@.@.@.@..@.@@..@@.@@@@@@@@.@@.@@@@@@@@.@.@@@.@@@@@@.@...@@@.@@..@@@@@@@.@@.@@@@@@.@...@@..@@@.@@..@@.@@. +.....@.@.@@..@@@@.@.@@.@.@@@@..@@..@@..@.@.@@@@@@@@@@@.@@@@@@@@@.@.@.@@@@@@@@.@@@.@@.@@@@@..@.@.@.@@..@.@.@..@@@@@@@.@@@@@.@@..@@..@.@@ +@@@.@.@@@@@.@@..@@@@..@@@@@@.@.@@@@..@@@@@@@@@@@@@@..@.@@@@@@@@@..@..@.@..@...@@.@@.@@.@@.@..@@@@@..@.@@@@.@@.@.@..@.@@@@.@.@@@@..@@.@@ +@@.@.@@.@.@.@@@.@@@@.@.@.@@@@@@.@..@@...@@@@@@..@@@@@@@@..@@@..@...@@.@..@@@@@.@.@.@.@@.@@@...@@.....@@@@@@@.@..@.@@..@@.@..@.@..@...@. +..@@@@.@..@.@@@.@.@..@@.@@@@@@..@@.@....@..@@@.@@..@.@.@@@.@@@.@.@@@.@@@@@@@@.@..@@@..@...@.@@@@..@@@..@@@@@@@@@@@.@@@.@.@@.@.@@@@@@@@@ +..@.@@....@..@@.@@@.@....@...@@@.@@..@..@@@@@@@..@@@.@@.@@@@..@..@@.@@@@.@@@@@..@@@@@.@@@.@@@@.@.@@.@.@..@@@.@.@@@@.@@......@.@@..@@@.@ +.@...@@@.@.@.@@...@@.....@@@..@.@@@.@@@@.@..@@.@@@@@.@.@@.@@@@@@@@.@@@.@@@@@@.@.@@.@@@.@@@.@..@@@.@@@@@@@@...@.@@@@.@.@@.@@@...@@.@@... +@@@.@@@.@@.@@@.@@.@@@@@@.@@@.@@.@@@@@...@.@@.@..@@@@...@.@@.@@.@@@@@@@.@.@.@..@.@@@@@.@@.@.@.....@@@@@.@@.@@@@.@.@.@@.@..@@@.@@@@@@.@@. +@@@@@..@.@.@@@.@.@@@..@@.@@.@@@@...@.@@@.@@...@...@@..@@@@.@@.@@@@.@.@.@@..@@.@@..@..@@..@@@.@@@@@@@@@@@@.@@@.@.@@.@@....@@@@@.@@.@@@.@ +.@@.@..@@@@.@@.@.@@@@.@@@@..@@.@.@@@@@@@@.@.@@@.@.@.@...@.@@...@@@@@@@.@@.@@.@.@@@@@@@@..@@@@@@@.@@@.@.@..@@@@@@@.@@@.@....@.@@.@.@@@.@ +@@@.@@@@@.@@@@..@.@@@@@.@.@.@@@@@.@..@.@@@@.....@.@@@@@.@.@@@@@@.@.@@...@..@@@.@@..@..@@@@@@@..@@@@@@@...@@.@@@@@..@..@..@.@@..@....@@@ +@@@@.@@@@.@@@.@@.@@@@@@@@@@@..@..@@@@@@@@@@@@@@@@.@@..@@@..@@@@@@@.@@@.@@@@@@@@.@@@...@@@@@@@@@@.@@@@@@@@@@.@@@@@@..@@@..@@@.@.@@..@.@@ +@@@@@.@@@@@..@@@@.@@.@.@.@@...@..@@@@.@.@@@.@@@@.@@....@@@@@@.@....@.@@.@@@@@.@@.@@..@@@..@@@.@@..@.@.@@@@@@@.@@.@@.@@@@@.@.@@@@...@@.. +@@@@@..@@@..@.@@@.@.....@@@.@@..@@@.@@@@.@@@..@.@.@.@@@@@.@@@@@@@@.....@@@@@@.@@.@@@@@...@@@@@@@@@@.@@@.@..@@@@@@@@@@@.@@@@@@.@@@@.@@.@ +@@@..@@.@@@@@.@@@@@@@.@.@@@@@@@...@@@@.@@@.@..@@@.@@..@@@@@@.@.@@@@...@@@.@@.@.@@@@@.@@.@.@.@.@@@@..@@...@..@@@..@...@.@..@@@@.@@..@.@. +.@@@@...@.@..@@.@...@..@@@@@@.@..@..@.@@@@@.@@@..@@@.@@.@..@@@@@.@@..@.@.@.@@@@@@.@.@.@...@.@@@.@.@@@@@.@@@@@@@.@@@.@.@..@@@@@@@.@.@.@@ diff --git a/04/main.go b/04/main.go new file mode 100644 index 0000000..b323020 --- /dev/null +++ b/04/main.go @@ -0,0 +1,66 @@ +package main + +import ( + "fmt" + + "git.z1glr.de/advent-of-code-2025/pkg/aoc" +) + +func testGrid(g *[][]string) int { + rollCount := 0 + + for yy, row := range *g { + for xx, roll := range row { + if roll == "@" { + freeCount := 0 + + for x := xx - 1; x <= xx+1; x++ { + for y := yy - 1; y <= yy+1; y++ { + if x < 0 || y < 0 || x >= len(row) || y >= len(*g) { + freeCount++ + } else if (*g)[y][x] == "." { + freeCount++ + } + } + } + + if freeCount > 4 { + rollCount++ + + (*g)[yy][xx] = "x" + } + } + } + } + + for yy, row := range *g { + for xx, roll := range row { + if roll != "@" { + (*g)[yy][xx] = "." + } else { + fmt.Print() + } + } + } + + return rollCount +} + +func main() { + lines := aoc.ReadFileRows(false) + + grid := aoc.RowsToGrid(lines) + + rollCount := testGrid(&grid) + fmt.Println(rollCount) + + for { + if newCount := testGrid(&grid); newCount == 0 { + break + } else { + rollCount += newCount + } + } + + fmt.Println(rollCount) +} diff --git a/04/test b/04/test new file mode 100644 index 0000000..8209399 --- /dev/null +++ b/04/test @@ -0,0 +1,10 @@ +..@@.@@@@. +@@@.@.@.@@ +@@@@@.@.@@ +@.@@@@..@. +@@.@@@@.@@ +.@@@@@@@.@ +.@.@.@.@@@ +@.@@@.@@@@ +.@@@@@@@@. +@.@.@@@.@. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..391b5cb --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.z1glr.de/advent-of-code-2025 + +go 1.25.4 diff --git a/pkg/aoc/readFile.go b/pkg/aoc/readFile.go new file mode 100644 index 0000000..fefa120 --- /dev/null +++ b/pkg/aoc/readFile.go @@ -0,0 +1,32 @@ +package aoc + +import ( + "os" + "strings" +) + +func ReadFile(test bool) string { + fileName := "input" + + if test { + fileName = "test" + } + + if cont, err := os.ReadFile(fileName); err != nil { + panic(err) + } else { + return strings.TrimSpace(string(cont)) + } +} + +func ReadFileRows(test bool) []string { + cont := ReadFile(test) + + rows := strings.Split(cont, "\n") + + for ii, rr := range rows { + rows[ii] = strings.TrimSpace(rr) + } + + return rows +} diff --git a/pkg/aoc/stringToGrid.go b/pkg/aoc/stringToGrid.go new file mode 100644 index 0000000..2393a49 --- /dev/null +++ b/pkg/aoc/stringToGrid.go @@ -0,0 +1,13 @@ +package aoc + +import "strings" + +func RowsToGrid(r []string) [][]string { + grid := make([][]string, len(r)) + + for ii, rr := range r { + grid[ii] = strings.Split(rr, "") + } + + return grid +}