diff --git a/2025/day-04/.python-version b/2025/day-04/.python-version new file mode 100644 index 0000000..c8cfe39 --- /dev/null +++ b/2025/day-04/.python-version @@ -0,0 +1 @@ +3.10 diff --git a/2025/day-04/README.md b/2025/day-04/README.md new file mode 100644 index 0000000..e69de29 diff --git a/2025/day-04/input-small.txt b/2025/day-04/input-small.txt new file mode 100644 index 0000000..8209399 --- /dev/null +++ b/2025/day-04/input-small.txt @@ -0,0 +1,10 @@ +..@@.@@@@. +@@@.@.@.@@ +@@@@@.@.@@ +@.@@@@..@. +@@.@@@@.@@ +.@@@@@@@.@ +.@.@.@.@@@ +@.@@@.@@@@ +.@@@@@@@@. +@.@.@@@.@. diff --git a/2025/day-04/input.txt b/2025/day-04/input.txt new file mode 100644 index 0000000..d35edbf --- /dev/null +++ b/2025/day-04/input.txt @@ -0,0 +1,140 @@ +@@..@.@.@..@@.@@@@@.@@@@@@..@@.@@.@@..@@@.@@@.@.@@@@.@@@.@@@.@..@.@@@@..@@@.@@..@@@.@@@..@@@@..@.@@.@@@.@..@.@@@.@@@..@@@.@.@@@@@.@.@.@@@@@@ +@.@@@@@@....@..@@@.@..@.@.@@.@@.@@..@@@..@.@@..@..@@@.@@@.@..@.@.@@..@@.@..@@.@@@..@.@@.@.@..@@...@@@@@@@@.@@@.@@@.@@.@@@@@@@..@..@@@.@.@@.@ +.@.@@@@.@@.@@.@.@.@@.@..@@.@@..@@@@@@@@@@@@...@@.@...@@@@.@.@@.@@@.@.@@..@@.@@.@@.@@..@...@@@@.@@@@@@@@@@@.@@@....@@@@@.@.@...@@.@@@@@@@.@@@ +@@@..@@@@.@@@@@@@@.@@@@@.@@.@....@.@..@.@@@@@@@...@@@@@@@@.@@...@.@@.@@@@@@.@....@@.@@@.@.@@..@@@.@.@@@..@.@.@@@.@.@@@@@@@@...@.@@@@@@.@..@@ +@.@@@@@.@@.@.@.@.@..@@@@.@..@...@.@@@.@.@@@@.@@.@@@@@@.@@@@@..@@..@.@.@@.@.....@@@.@@@.@..@@@.@@.@..@@@@.@.@@@@..@@@@@@.@@@.@@.@@..@@.@.@@@@ +@@.@@@@@.@@@.@@@@@.@@.@.@@@@.@@...@.@@@..@@.@@.@@@..@@@...@@.@@@@..@@@@@@@...@.@@@@@@....@..@@@@@.@...@.@.@@.@...@@@@.@.@@@.@@.@.@@@@.@.@@@@ +...@.@@.@@.@.@.@@@@...@@@@@@@@@.@.@@@.@@.@@@.@@.@@@@.@@@@@@@@@.@@..@..@.@@@@@@@@@@@@...@.@.@@@.@.@.@.@@@.@..@@@@@@@@@@@.@@.@...@@@@@@@@.@@@@ +..@@@.@.@.@@@@@...@@..@@..@@.@...@@@.@.@.@.@.@@.@.@@@.@@.@.@@@@.@.@@@@@@@.@@.@.@@@@@@.@.@@@@@@@@@@@.@.@@@@@.@@@@@@@@@.@...@@@.@@@@.@..@@@@.. +.@@@@.@@@.@.@@@.@@@..@@..@@@@@@.@..@.@@.@.@@@@@..@@@@@@@@.@.@@@.@@@@@.@.@@@@...@@.@@@.@.@@@@@@.@@.@.@@@@.@.@@@.@.@@@@@.@@@@...@@@@@@@@@@.@.. +@.@....@@.@..@@@.@.@..@@@@.@.@@.@..@@.@.......@.@@@@@@@.@@@@@@@@.@@@.@.@@.@@@@.@..@.@@@@@@.@@@@....@@.@@@@.@..@@@.@@.@.@@@@@@@@.@@@@.@.@@..@ +@@@@@.@@.@.@.@@.@..@@@.@.@@@@.@@@.@.@.@@@.@.@@@.@@@@@..@@@@@@..@@@@@@@@@@@@@@.@@@@.@@@@...@.@@@@..@@@@@@@.@@@@.@@.@@@@@@.@@@.@.....@@@@@@.@. +@.@@...@@@.@@..@@@@..@@.@@.@...@@@@@...@@@@.@@@.@@.@..@@@@..@.@@@@..@@@.@..@@@@..@.@@.@.@.@@....@.@@..@@.@@..@@@@...@@.@..@@@@@@@...@@@..@.@ +...@.@...@@@..@..@.@@@@.@.@....@@@@@@.@..@@@@@.@@@@@@@@@@.@@@@@@@@.@@..@@@@@@@@@@@@@@.@.@...@@....@@.@@.@@@.@@@@@@.@.@..@@@@@@.@.@.@@..@@@@. +@@@@.@@@@.@.@@.@.@..@@@..@@@.@@@@@..@@@@@@.@...@.@@@.@.@..@@@@@@.@@.@@@.@@..@@@@@@@..@@@@@@@@..@@..@@@@@..@.@.@@@.@@..@.@.@@@@@@@.@.@@@.@@@. +@@@@@@@@.@@@@@@@.@@@.@.@.@@.@..@@@@@@@.@@..@@..@.@..@.@@@@@@..@.@.@@.@.@@@.@.@@@@..@@@@@@@@....@.@.@@@@@@@@@.@@@..@@@@@@..@@@@...@@@...@.@.@ +..@@@..@.@@.@.@@...@@@..@.@@@...@..@@.@@@@@..@@@@.@@@@.@@@.@@.@@.@@@@@@@..@.@..@.@.@@@..@@@@@...@@..@....@......@.@.@.@.@@@.@.@@@@@@@.@@.@@. +.@@.@@@@@.@..@@@@@@.@....@@@.......@..@@@.@@@...@..@@..@@@@..@.@@@@.@@.@@..@@.@.@@@@.@@.@@.@@@@@...@@@@.@@@..@.@.@@@.@.@@.@@@..@@@..@@@@@..@ +@.@.@..@.@.@.@@.@@@@@@@@@@@@.@@@@.@@..@.@.@@@..@@@@.@@@@@...@.@@.@@@@@@@...@@..@@@@..@@....@.@@@.@.@@@@@.@@@@@@@..@@@@@@@@@.@@@@..@@@.@....@ +@@..@@.@@.@.@..@@...@.@.@.@@....@@@@@@.@.@@@@@@.@..@@@@@@.@@@@..@.@.@.@.@.@@.@@...@@@.@.@@.@@.@@@@@@@.@..@@.@.@.@@..@.@@@@@@@@.@@@@..@@...@. +.@@..@@@@@@@.@.@@@@.@@@@@@@@.@.@@@@@@@@@.@@@@@.@@@@..@@@@..@.@@@@.@.....@.@@.@@.@@@@@..@@@@@.@@@@@.@@@.@@.@@@..@@@..@@@@.@@.@@@@@@@@@@@@.@@@ +.@..@@@@@@@@@@@.@@.@@.@..@..@@@...@@..@@@.@@.@.@@.@.@..@@.@@.@@@@@.@@@.@.@@@@.@@@@@.@...@@.@@.@.@@..@@@.@@@@@.@@@@@.@....@@@@@@@@.@@.@@@@@@@ +@..@@..@@@@.@@.@.@.@.@.@@@@..@@.@..@.@@@@@@@.@@..@@@@@.@@@.@@@.@.@@.@@.@@@.@@@@@@@@@@@@@.@@@@@@.@@@@@@@...@@@@@@@.@@@@.@.@.@@@.@@@.@..@@@..@ +@@@@@@@@.@.@@..@.....@.@@@...@.@@..@@@..@..@..@@@.@@@@@@@@.....@..@@.@.@.@.@@@@.@@.@@.@@@@@@.@.@.@@.@@@@@.@.@@@...@@.@@@@@@@...@.@@.@@@..@.@ +.@@@@@@..@.@@...@@@@@@@@@@@.@@@@@..@...@.@.....@@@.@.@@@.@@...@.@.@.@@@@@@.@@@@@@.@@@@@...@@@@.@..@@.@@@.@@.@.@@@..@@@@@@@@.@@@.@@..@.@.@.@@ +@.@@.@@@.@.@.@.@@@@@@@@.@@@@..@.@@@@@.@@.@@....@..@@.@..@@@....@@..@@.@@@@@@@@@....@@.@@@.@@..@...@@@@@@@.@@@@@.@@@.@@@@@@@@@@...@@.@.@@@@@@ +@@@@@@@@@...@.@.@@@.@@.@@.@.@..@..@..@..@.@.@@@.@@@@@@@@@...@@@@@@@@@@.@@@.@@.@@...@@@@@@@.@.@@.@@@@@.@.@@..@..@....@.@@@.@...@..@..@@.@@@@@ +@@@@@@@@...@@@.@@@....@@@.@..@@@@.@@@@@..@@@...@@.@.@@@.@@.@.@@.@.@@@@.@@.@@@@@@@@@@@@..@@....@@.@@@@@.@@@@@....@@@....@@@@@.@.@@.@@..@@@@@@ +.@@@@.@@@@....@..@.@@@@@.@@@@@@..@..@@.@@@@.@@@..@@@...@.@@@.@.@@@@@@@..@..@...@@@.@@@.@@@..@@@@@...@...@..@@@@@.@@..@@...@@@.@@@@@.@@@...@@ +@..@@@...@@@.@.@@@@.@@@@@@.@@@@.@@.@@@@@@@..@@@..@@@@.@@@@..@@@..@.@@@...@@.@@@@..@@@@@@@@.@@@.@@...@@...@.@..@.@.@@.@.@@@@.@@.@..@@..@..@@. +@@@@@@@..@@..@@.....@@..@@@..@@@@@..@@@@@.@@@@@.@..@@@@..@.@@@@...@..@@@.@.@@@..@@@..@@@@@..@@@@.@.@.@@.@@@@@@...@@@@@@@@@@..@@.@.@@.....@@@ +.@@@@......@@@.@@..@@@.@..@.@@@@@@.@.@..@@.@@@.@@@@....@@@@.@@.@@@@@@@.@.@@@..@@@.@@@@@@..@@@.@@@@.@@@@@.@@@@@@@.@@.@@@@@@.@@@@@@@@@.@..@@@@ +....@@@@@.@.@@@@@@@@@.......@.@@@@@@..@@.@@@@.@@@..@@@.@..@@@.@.@@.@@@.@@..@@@.@@@@@@@.@.@@@@@@...@@.@..@.@@.@.@@.@@@@@.@@@@@.@..@...@@@.@@@ +@@@@@@@@@@@@.@@.@@@.@@.@@.@@@..@@@@@.@@@.@..@.@.@@.@@.@@@@@..@@.@@..@....@..@...@@@@@..@..@.@.@@..@...@@@@..@.@@@@@@@@.@@@@@@@@@.@..@.@@@@@. +@.@..@@@@..@@.@@.@.@@@@@..@@@@@@@....@@.@@..@@.@@@@...@@@@.@@@@@@@@@@.@.@@.@..@.@@@@@@@@.@@@..@@..@..@@@..@@@@....@@@@@@.@@..@@@@@@@@@@@@@@. +.@@.@.@.@@@@@@.@@@.@@@@.@..@.@@.@@@@..@@@@@@.@@@.....@.@.@....@.@@@@@.@@@@.@@@@@@@@@@.@@@.@@@@@@@..@@..@@.@...@.@@@.@.@.@@.@.@@@@@@..@@@@.@@ +@.@@.@@@@@@@@@.@.@@.@@@@@@@.@@....@@.@@.@@@@@.@@@@.@...@@.@@@@.@@@@@.@..@@@@@@@.@@..@@@@@..@@.@...@@.@@.@@@@.@@@@..@..@@@@@.@@@.@@.@@@@@...@ +@.@@@.@.@..@.@@.@.....@.@.@@@@@@@@@.@@@@@@@@@@.@..@.@@.@@...@@@.@.@@.@.@.@@.@@@..@@@@@@.@@@@@@@@@.@....@.@@@@@@.@@@@@.@@.@.@@@@@@@.@@@@@@@.@ +@.@...@@@...@@.@@..@@..@.@.@@..@.@.@..@..@@@@@@@..@@@@@@@@@@.@@.@@@.@@@@..@..@.@@..@@@.@.@.@@@.@.@.@@@@@@....@.@@@@@@@@@.@@@@@@..@@@.@@@.@@@ +.@@@@.@@@.@.@.@@..@@@.@@@@..@@@.@@.@@@..@@@.@@..@.@@@@@@..@@@@@.@@@.@@..@.@.@@@@...@@.@...@.@@@.@@@@.@@@.@..@@@@..@@@..@@.@@.@.@@.@.@.@@.@@@ +..@@@@..@@@..@.@@@@@.@..@.@@.@...@@@@@@@@..@.@@@@@@...@@@@.@.@@@....@...@@.@..@@@@@.@.@.@.@@.@@@@@.@@@@@..@@@@@@@..@@.@@.@@..@...@@@@@@@.@.@ +.@@@@.@@@@.@@@@@..@..@@..@.@.@@....@@@@.@...@@@@@@@@..@.@..@.@@@@@@@@@@@.@.@@..@.@@.@.@@@@@@.@@@.@@@.@@@..@@..@@..@.@@...@@.@..@..@.@@@.@.@@ +.@@@@@@@@@@@@.@@@.@@...@..@..@..@.@.@@@.@..@.@@...@@.@@..@@@@@@..@@@@@@@.@.@@@@@.@@.@...@@.@@.@@@@@@.@@@.@.@@@@..@...@@@@...@@.@@@@@@@@.@@.@ +.@@@@.@..@..@.@@@@@.@.@@@@.@.@.@.@..@.@@@@..@@@..@@..@..@@@@@.@.@@@@...@..@....@..@@.@...@@.@.@@@.@@@@.@@@.@@@@@....@@@@.@@@.@..@@@@@@@..@.@ +@@@@@@@@.@@@...@@..@.@.@.@@.@@.@@..@@@..@@.@@@@@@.@@.@@...@.@@@@..@@@@@..@@..@.@@@@@@@@@..@@...@@.@@@.@@@@@@@.@@..@@.@@@@.@...@.@.@..@@.@.@@ +@.@@@.@.@@@@@@@@@@@..@@...@.@@@..@@@@@..@.@@@..@.@@@@.@@@@@@@@@.@.@@@.@@@@@@@..@.@@...@@@..@@.@.@@.....@@@.@@.@..@@.@..@@@.@.@.@.@@@.@@.@@@@ +@.@.@....@@@.@@..@@@.@@@@@@@.@.@@.@.@@@@@@@.@@.@@@@@.@.@@....@.@@@..@@@@@.@@@@.@.@@@.....@@@@@@@@@@..@..@@@@@@..@.@@@@@@@.@.@@.@@@.@@@@.@.@@ +.@@@@.@@@.@..@@@.@@@.@..@@.@@.@.@@.@@@.@.@@@@@.@@.@..@.@.@@@@.@@@.@@.@@@..@.@.@@@..@@@@@@@@@@@.@@@@@@@@@.@@@@@@..@@@...@@@.@@.@.@@@@@@.@@@@@ +@@.@.@@@@@@@@@..@@...@@@@..@@@.@@.@.@.@@....@@..@@.@@..@@@.@@.@..@@.@@@@.@@@@@@@@.@@@@@@@@@..@.....@@@@....@@@@@...@...@..@@@@@.@@.@....@.@@ +.@@.@@...@@@@@@.@@.@@@@.@.@@@@.@@.@..@@@@.@...@@@@.@.@....@.@@@@@@@@@.@@..@@.@.@@@@@@.@.@@.@.@@@@@@....@.@@@@@.@.@.@.@@@@..@@@@.@.@..@..@@@@ +.@@@@@.@@@.@.@@...@@..@@@..@@...@@@@..@...@.@...@@.@.@@@@...@@@..@@@@@@@@@.@@.@..@.@.@@.@@@.@@@..@@@@...@@@@@@@..@.@@@@@@.@@.@.@@@@.@...@@.@ +@@..@.@.@@.@.@@.@.@@@..@@...@@@@@@@@@@.@.@@@@@@.@.@.@@..@@@..@...@@@@..@......@.@.@..@.@.@.@.@@@@.....@.@.@.@@.@@.@.@@@@@@.@@@@@..@.@.@..@@@ +.@@@@@@@@@@.@@@@..@.@.@.@@@@@@@@.@@@.@@.@@..@@..@@@.@@..@.@.@.@@@..@.@.@@@.@..@@@.@@.@.@..@@@...@.@@@@...@@@.@.@@.....@@...@.@@.@@@@@.@@@@@. +.@@@..@@@@@@@.@@@.@@@@..@@@..@..@@@..@@@..@@.@@.@@@@@@@.@.@@@.@.....@@@@@.@@.@@..@@@@.@@....@@@..@@@@.@@@@@@.@@.@..@@@.@..@@..@..@@.@@@.@@.. +@@@@@@..@.@@@@@.@@@@.@..@.@@@@@..@@@@..@..@@@@@.@@@@@@@.@..@@..@@@@@@@@..@@@@.@.@@.@@...@.......@@.@..@@@@.@..@@@@...@.@@@.@......@@...@@@.. +@.@.@.@....@.@.@@.@@@@@@@.@..@.@..@@.@.@.@@@@@@..@...@...@.@.@.@.@@@@@@@@@..@@@.@@@@@@@@@.@..@@@@@@.@@.@@@@@@.@@.@@...@@@@@@.@@@.@@.@..@..@@ +.@@@.@@@@@@@@.@@@.@..@@.@..@..@@.@@@..@@@@@@.@@@@..@@....@@@@.@.@@.@@.@@@..@@@@@@@....@..@@.@@@@@..@..@...@@.@@@@@.@@.@@@@.@@@@@@.@..@.@@@.@ +@..@...@@@@..@@..@@..@@@.@.@@@@.@..@@@.@.@.@@@@@.@@...@..@@...@....@.@.@@@@@.@@@.@@..@@.@@@.@.@@..@@@@..@@@@@@@@@.@@@@@.@@.@@.@.@@.@.@.@@@.@ +@.@.@@@.@..@.@.@.@.@@@@@@@.@.@@.@..@@@.@@@@@@@...@@@.@@@.@@@@.@@@....@@@@@@@.@@.@.@@...@..@@.@..@.@@.@.@@@@..@@@.@@@@@@..@@@..@.@@@@@@@@@@.@ +.@@.@@@@..@..@@.@.@.@@.@@@@..@@.@....@@@@.@@@.@@@.@@@@@@@@.@@.@@@.@@@@.@@@@@@@@@.@@@@..@@.@..@@@.@.@@@@@@@@@@@.@@.@.@.@...@@@@@.@@.@...@@@@@ +.@..@@...@@.@@@@@@@@@@.@@@.@@.@@@@@@@.@@.@@@@.@@..@@.@.@@.@@@.@@@@.@.@@@@..@...@.@...@@@.@@@@@..@@@@@@@..@.@@@.@.@.@.@.@@.@@@@..@.@..@.@.@@. +.@..@...@.@@.@..@@@@@@..@.@@@@@@...@@..@@.@@@@.@....@.@@@..@@@@..@@.@.@..@.@@.@.@.@@@.@..@.@@@@@@.@@@.@@.@.@..@@.@@.@.@@@.@.@.@.@@@.@@@.@@.. +.@@@.@.@..@..@@@..@@@.@@.@.@@@.@@@.@@@.@@@..@@@@@@..@@@@@@@.@@@@.@.@...@@@@@@@.@@@@...@..@@@@.@.@@@......@@@.......@@.@..@@@@@..@.@.@@@...@@ +.@@@@@@.@@@.@@@@@@@.@@.@@.@@@@@..@.@.@.@..@@.@.@.@@@.@.@@@.@@@.@@.@@..@@@..@@@@...@@..@.@.@@@..@@..@.@@@.@..@.@@@@@@@@@...@@@@.@@@@@@@.@.@.@ +@.@.@@.@@@....@@@@@@@.@@@...@@@..@.@@@@@@@@@@@@.@.@@@@@.@@@.@@.....@.@@@....@.@@....@@@@@@@.@@@@@.@@@.@.@.@@.@@@@@@@@..@.@.....@@@@@..@@@@.@ +@....@...@.@.@..@@@@@......@.@...@.@.@..@@.@@@@@@..@@@@.@.@.@.@.@.@...@@@@.@@@.@...@...@@@...@@@@@@@@@@@..@@@..@.@@@@@@.@@@@@....@@@.@@.@..@ +@@@@.@..@@@.@@@..@@.@@@@@@.@.@.@.@@@@@@@.@.@@.@@@.@@...@@.@.@.@@..@@@.@@@@@.@@.@.@@@@@.@@@@@@.@@.@@@@@.@.@@.@@....@@....@....@@@@.@@.@@@..@@ +@.@@@@@@@@@..@@@@@..@.@@.@..@@@.@@@@@@@@..@@@@@..@@@.@.....@@@..@.@@@@@@..@@..@@@.@.@..@.@@.@@@@@@.@.@@.@@@.@@.@@.@..@.@.@@@@..@.@@@@..@.@.@ +@@@@@.@.@.@@...@@...@@@@@@@@.@..@..@@@@..@@@..@.@@.@.@@@.@.@@@...@.@@@..@@@@@@@@@....@@@@@.@@@.@@..@@...@@@.@.....@@..@@@@@@@@@..@@@@@.@@@@@ +@@@..@@@.@@@@@@@@@@@@..@..@.@@.@@@@@@@@@@@@@.@@@@@@.@..@.@@@@@@@.@@@@@.@@@@@@@...@@@@@...@@.@.@@@@..@@@@@@.@@@@@..@@@@@@.@...@..@@@.@@.@.@@. +.@@..@@@@@.@@.@@@@@@.@@@.@@.@.@@@@.@@..@@@....@@@@@@@.@@....@@@@@@.@@.@@...@..@@@@@@..@.@.@@@@@@@@@@.@@@@.@@@@.@.@@@@...@.@.@@.@.@@.@.@@@@.. +@.@@.@@.@@@@@@@@@.@@@@@@@.@@@..@..@.@...@..@..@.@....@@.@@.@@@@.@.@@.@@.@@.@.@@@@@@@@@@@.@.@@@..@@@..@@@.@@@@@@@@.@.@@@@@@@.@@.@..@@@@@@@@@@ +..@@..@.@@@@@.@@@.@@@.@.@@@@.@.@@@@@@@@@@@@@.@@@@...@@@@@@@@@@.@.@@.@...@@@@@..@@.@@@@..@@@...@..@@@.@@@.@@@..@@@@.@.@@.@@@.@.@.@.@@@.@@.@.. +@@..@@@@@...@@@.@@@@.@...@@@@@@@.@@@.@...@@@@@@@..@..@@@@@.@.@@.@.@@.@.@.@@@@@@...@.@....@@@..@.@@@@@@@@@@@@.@..@@@@@@@@@.@@.@@@@@..@@@@.@@. +@.@@.@@..@...@@@@@@..@.@@...@@.@@@@@@.@.@...@@.@@@.@.@@@@@.@@@@@.@.@@@.@.@@@@@@@@@.@@@.@.@@@@@@@@@@@@.@.@@@.@@.....@.@@@@@@@@@@@@@@@..@...@@ +@.@.@.@.@.@@...@@@@@@.....@.@.@..@..@@@@@@@..@@@@@@....@@.@..@@..@.@@..@@@.@@.@@.@@@@@.@....@@@@....@.@@@...@..@...@@.@@@@@@@@@@.@@...@@@@.@ +@@@.@@@...@@@.@@@@@@@@.@.@@...@@@@..@..@@@@@..@@@@@@@@@....@@@@@.@@@....@.@.@.@.@@.@@@@..@@@.@@..@.@.@@@@@@@@@@@@@@@@.@.@.@@@@@....@..@@.@@@ +...@@@.@@.@@.@@.@@...@.@.@...@@.@@.@@.@..@@@@.@@.@@@@.@@.@@..@@@@...@@@@@.@..@.@@@@@@..@@..@@@.@.@.@@..@@@@@@..@@..@.@@@@@@@@.@...@@.@@.@@.@ +@@@@..@@.@@..@.@@@@@.@.@@@@.@@..@..@@.@.@@@@..@@@@@@@@@@@@@.@.@@@@.@.@@@@@@.@...@@@@.@.@@...@.@@@@.@@@..@@@..@.@@@@@..@.@@.@@.@@@@@@@@.@@@@. +@@@..@@..@@@@@.@@.@..@@@.@..@.@@.@@..@.@.@@.@....@@@...@@@.@@@..@.@.@.@@@.@.@.@....@@....@@@@@.@@@@@@@.....@@..@.@@@.@@@@....@@..@@@.@@.@.@. +@@.@..@@@@@@@.@.@@.@@@.@@@.@@.@@@@@@@@@@.@@@..@.@@@@..@@.@@.@.@.@@@.@.@@@@@@......@@@..@@@.@.@@.@@@@..@@.@@.@.@@..@.....@@@@@.@.@@.@.@.@.@.@ +@@@.@@@@..@.@@.@@@.@.@@@.@....@.@.@@..@..@@.@@@@@@.@@.@@@@.@@@@@@@@@@@@@..@.@.@@..@..@@.@@@@.@@.@@.@@..@@@@@@.@@@@@.@@.@@@.@@.@...@@.@@.@.@@ +@.@@@@@@@..@.@@@.@.@@@.@.@@@@@..@@@@@...@@@@.@@..@@.@.@...@@@@@@@@@@@.@@@@@@...@@@@@.@@@@@..@@@.@@.@..@.@@@@.@@.@@@.@@@.@@@.@.@@@@@@@@@..@@. +@.@@.@..@@.@@@@@.@@.@@@.@..@..@@@.@.@.@@@@@.@@..@.@@....@@@@@.@..@@.@@.@@.@@.@@.@.@@.@@@.@@@.@@.@.@@@.@@@@@@@..@@@.@.@@.@.@@.@@@.@@...@.@@@@ +@@......@@@@@.@.@.@.@@@@..@@.@@@@@@@@@.@@@@.@@@.@@@.....@@@@@@@@..@@@@.@@...@@@@@@@@..@.....@.@@@..@.@@@@@@@@@.....@@@@@@@@.....@@.@@..@@.@. +@@@...@@.@.@.@@.@@.@..@.@@.@@@@@..@..@.@@@@@@@.@@.@@@..@..@.@@@@.@@.@@@@@@@@@@@.@..@@@@.@..@@@@@.@.@@@@@@@@@..@@.@@@@...@@@@@@@.@@..@@.@@@@@ +.@.@@@.@@@@.@@.@@@@@...@@..@@@@@@@@@.@.@@..@.@@.@@@.@@@@@@.@@@@...@@.@@@..@...@@.@@@@.@....@@@.@....@....@@@@@@.@@@..@@.@@..@@...@@@..@.@@@. +.@....@.@@@@@@@@@@...@@@@.@.@.@.@@@.@@@@@@@@@.@@.@@@..@.@.@@@@.@...@@@@..@.@@@@..@@.@@@@.@@@@@@.@@.@.@@.@..@@@@@@@@@@@@@@@@.@@@@@@.@.@.@.@.. +..@@@.@..@@..@@@@@@@..@@@.@@@@..@@..@@@@.@@@@..@@@.@@@.@@@@..@@..@.@.@.@@@@@@@...@@.@@@@@@.@@.@@@.@@@.@@@@@@@@.@.@@@@@@@@@.@.@....@@.@@@@@@. +@.@@@.@@@@@.@@@@@.@@@...@.@@.@@@@@@.@..@.@@@@@@.@@.@@@@@@.@@@@@.@@@@@@...@@..@@@@@..@.@@@.@.@@.@.@.@@.@@@@.@.@..@@@.@.@@@...@@@..@@.@@@@@..@ +@@@.@@@.@@..@..@@@....@.@@@..@....@.@.@@@.@....@@@..@@.@@@@.@.@@...@..@.@@@.@@@@@@@@@..@.@@...@@@.@@@@@...@@....@@@@@@.@....@@@.@@.@@..@@@@@ +@.@..@...@@..@.@@@..@@@@@@.@..@@@..@@@@@.@@@@@@@.@..@@@@...@@.@@@@.@@@@@.@.....@@@@@.@@@@@.....@@.@..@@.@@@@@.@@.@@@@@.@@.@@.@@.@.@@..@.@.@. +@..@@@@@@.@@...@.@..@@@@.@@@.@@@@@@@@.@..@@@@...@@@@@@@.@.@@.@@@@..@....@.@....@...@@.@@.@.@.@.@.@@.@@.@@.@@@..@@@@.@@@@.@@@.@.@@...@..@@... +@@@@@@.@@@@@.....@@@@@@@@@@@..@.@@@@@@@@..@...@.@@.@@@@.@@@.@@@.@.....@.@@@.@@..@@@@...@@..@.@@@@.@@.@@@@..@@.@..@@@@@@@.....@@.@...@@..@.@. +@@@.@@@@..@@.@.@@@@..@.@@.@@..@@@..@@.@@.@@...@@@@@..@..@@@@.@@.@@@@@.@@@..@@.@@@@..@.@.@...@@.@@@@@@..@@@@@@@..@@@@@@@.@.@.@.@.@...@@@.@@.@ +@@@@.@..@@.@.@.@@@.@..@@.@@@@@@@..@@@@@@@@@@@.@@@@@@.@@.@.@@.@@..@@@.@@@@@.@@.@..@@@.@@@@.@@@....@@@@@@@.@....@.@@@@@@@.@@@@.@@@...@.@@.@@@@ +@@.@.@@...@@@.@@..@@.@@@@.@@.@@.@..@.@..@@@@@@..@...@@..@@@.@.@@@@.@@.@@@.@.@@.@.@@@@@...@.@.@@@..@@@@.@@@@@.@...@@@.@@@@.@@.@...@.@@@.@@@.@ +@.@.@..@@@@..@@.@.@..@@@@@.@@@.@....@@.@..@@.@.@..@@..@....@@@.@@@..@@.@@@@@@.@.@.@@@@@.@@..@.@@.@@@..@@@.@@.@@@@..@@@@@@@@@.@@@@@@.@@@@.@.@ +.@.@@.@@@.@..@@..@@..@@@.@.@@.@@.@@.@....@@.@@.@.@@@@@.@@@.@.@....@.@@@.@@@@@@@@@@.@@@..@@@@....@@.@@...@.@@...@.@@....@...@.@@.@.@@..@.@@@@ +.@@@@@@.@@@@@@@..@@@@@@@@@@..@..@@@@@@@@@@....@.@@@@@@.@@@@@@@@@.@@..@.@...@......@.@@@@@.@.@.@@.@@....@@..@@@..@@.@@.@..@@@.@@...@@@@@@@@@. +@@@.@@@@@@.@...@.@@...@..@@@@.@@@@@..@.@@.@@@@@@@....@@@.@.@@.@..@.@.@@.@.@@..@.@@@@.@....@...@@@.@@@@.@@@@@@@@.@...@@@@@@@@@@.@@@..@.@..@@@ +@@@@.@@..@..@@@@.@.@@@..@@.@@@.@@.@@.@@@..@@@@.@@@@@@.@@..@.@@@.@.@@...@..@@@...@.@@.@@.@.@@@@.@.@...@@@.@@@.@@.@.@@.@@.@@@@@@.@@@@.@@..@@@@ +.@.@.@@@@@@@@@.@...@..@@.@@@@@@@@@.@@@@.@@..@@.@@.@@@@.@@@@@@@..@@..@...@@.@@@@@@@@@.@@@@@@@@@@@@....@.@@@.@.@@@..@@..@@.@@.@@.@..@@.@.@@@@@ +.@@.@@@....@@...@@.@@@.@@...@@..@@.@@..@@@@...@@@@@..@@.@..@.@@@.@.@..@..@@@@.@@..@@......@.@@@@@@.@....@.@.....@@@.@@.@@@@..@@.@@@@..@@..@@ +..@.@@@@@.@@.@..@..@@.@@@@.@@@...@..@@@.@..@@@.@@@.@@...@@@@@@.@@.@.@@@@..@@@@@.@@@.@.@@@@@...@...@@@@.@@@@@.@@@@@@.@@@.@@@@@@..@....@.@.... +......@.@@@@@@@..@@@..@@@@@.@@@.@@@.@@.@.@.@@..@@@@.@.@@...@.@@@@.@@.@.@.@@@@@.@@@@@@@...@@.@@@@@..@@@.@@@.@.@@@@...@@@@@@.@@@.@@@@.@..@@@.@ +@.@@@@.@@.@@.@.@@.@@@@@@@@@@@@@@@@@@@@@@.@@@@.@.@.@@@@.@..@@@..@.@..@@@@@..@@@@@.@..@@.@@@@@@.@@@@@@.@@.@@@@@.@@@.@@@@.@.@@@@@@..@@.@@..@@@@ +.@@@@.@@@@@@@@.@@@@@.@..@.@..@..@@.@@@@@...@@@.@@@@@@.@@@@@@@@.@.@@@@..@@..@@@.@@@@@@.@.@@@@@@@.@@@.@..@.@@.@.@..@@@.@@@@@.@@@@@...@@@.@@.@. +@...@@@@..@@.@@@.@@@.@@@@@.@@@....@@@@@@@@@@.@@..@.@.@.@.@@..@.@@@@@.@@.@.@@@@@.@@@.......@..@@......@@..@@.@@@.@@@@@@.@.@@@@@.@@@@.@@@@..@. +.@@....@..@.@.@@@@@@@@@@@@..@@@@.@@@@@@@@@..@@.@.@@@@.@@.@@@@@@@.@@@..@.@.@@@@.@.@@@@@@@@.@@@@..@@@..@@@.@@@.@@@@......@@.@@..@@.@@@@.@...@. +@@@@@@@@@@@@@@@@@@.@@.@...@@.@..@@.....@@@@@@..@@.@.@@..@..@@@...@@....@@@@@.@@@@.@@.@@@@.@..@@.@@.@@@.@@@......@...@...@@@@@@@@@@@.@@@@@.@@ +@@...@@@.@@.@.@.....@.@@@@@@@.@.@.@@@..@@@@@..@@.@@@@@@@@@@@@@@@.@@..@@@@...@@@.@@.@@.@@@@@.@..@@@.@@@@@..@@....@.....@@@..@@@@@@@@....@@@.@ +@@@@.@.@@@@@@@@..@..@.@@@@.@.@@..@@@@@@@.@@@@.@..@@@@@.@.@.@@@@@@..@.@.@...@@@@@@@@....@.......@...@@@@@@@.@.@..@@@@@..@@@@@@.@@@@@@.@@.@@@@ +@.@@@@@.@@@@..@..@.@@..@@..@@@..@@.@@...@@@.@.@@.@@@@@@@@@@..@@.@@@@@@.@@@..@@.@@@@@@@.@.@@..@.@..@@.@@@@.@@.@@@..@@.@@@.@..@@@@.@@@@.@.@@@@ +.@@@@@@@....@...@.@.@@...@@@@....@..@.@@@@.@.@@@@@.@@.@.@@@....@@.@@.@.@...@@.@...@.@....@@@.@@.@@@@.@@@.@.@.@.@@.@@.@@@@.@@@@@@.@@@@.@@@@@. +@@@.@@@@.....@.@.@@@.@@....@@..@@.@@@@.@@.@@.@.@@.@@@@@@@@@@@@@@@..@..@@@@@@..@@@.@@.@..@...@@@.@@@@.@@@.@...@@@@@@@.@@@.@@.@@.@.@@@@@@@@.@@ +..@@@.@.@@.@@.@@.@@.@@...@@.@@..@.@.@.@..@@@@.@@..@@@@@@@@.@@@@@@@@.@.@.@@.@.@@..@@.@@@@@.@@@...@@@.@.@..@..@@@@@.@@..@@@@@@...@.@...@@@@@@. +@@.@.@@..@@@@@@@.@.@@@@.@.@.@.@@@.@.@@@..@.@.@.@@.@@@@@@@@..@.@@.@....@.@@@@@@@@@@..@..@@@@@@@..@.@@@.@@@@@@@.@@..@.@@@@@@...@@@...@@@@@...@ +@@@@@...@@@@..@@@@@@@@@@.@@@.@@@@@@.@.@@.@@...@..@.@@@...@@@..@@.@.@@@@@@@@@@...@@.@@.@@@.@@@.....@@@@@.@@@@@@@@.@@@...@@.@@..@.@@@@@@@.@@@@ +...@@@@@.@.@.@.@..@@@@.@@@@@@@@@@...@.@.@@@...@@@..@@@@@.@@@@@@@@@@@@@.@@@@@@.@...@@@@.@@@@@.@.@@.@...@@.@@.@@@@@@@@@@@@@.@@..@.@@@@.@@@.@@@ +@@.@@..@@@@.@@..@@@.@@.@.@@@@.@@@.@@@..@@....@@@@..@@@...@@@.@@@.@.@@@.@@..@@@@@..@..@@..@@..@.@..@..@.@@@@.@.@.@@@@@@@.@@.@@@@@@..@@..@.@.. +@@@.@@.@@@.@@@.@..@.@@...@@.@@@.@..@.@@.@....@@@.@.@@@.@.@@.@@.@@.@@.@.@.@@.@..@.@.@@.@@.@@.@.@@@@@...@@@@..@@.@@..@.@@@@@@..@@@@.@@@@..@@.. +@@.@.@@@@@@@@@@..@@..@..@@@@@..@@@.@.@@@.@@@@.@@....@@.@.@@..@@.@@@@.@@.@@@@.@@.@@.@@@@.@...@@.@..@@@..@.@.@@.@@@@.@.@@@@.@.@@.@.@..@.@@.@.@ +@@@@@..@@.@...@@@@@.@@@.@@@@@@@.@@@.@@@@@@@@@@@.@@.....@..@..@.@@@@@@@@@.@@@.@@.@@..@.@........@..@.@@@@@@@@.@@.@.@.@@.@@@@.@....@@.@.@@@@.@ +@@@.@..@.@@.@@@@@..@@@@.@@..@@@@@@@@@@@.@@@@@@@..@@.@@.@@@@@@@@.@@@@@...@.@..@.@..@..@@@.@@.@@@.@@.@@.@....@@@@@@@@@.@@..@.@@@@...@.@@.@@@@. +.@.@@...@@.@@.@.@@@@.@@..@@..@..@@.@@@.@@@@.@.@@.@.@@@@@@@..@@@.@@@@@@@@.@@.@@@..@..@@@@@.@@@.@.@@@@.@...@@@@@@@@@@.@@.@@.@@@.@@@@.@.@@..@.. +@..@.@..@@...@.@@@@..@@.@@@.@@@@@.@.@@@@..@@@@@.@@@@.@.@@.@@.@@@@.@@@..@@@@@..@..@@@@@@@.@...@@@@..@@@@@@@.@.@...@.....@@@@@..@.@.@@.@@@@@.. +.@.@@@@...@@@.@@@@@.@@@@@@.@@@@@@..@@..@@@@.@@@@@@@@@@@@@.@@@@@@..@@@@@.@@@@@@@@@.@...@@@@@@@.@.@@.@.@@@..@@@@@@@..@..@@@@@@@@..@@@...@@@.@. +.@@@@..@@@@@@@@@@@@@@...@.......@.@.@@@@@@.@.@@@@@@@@@@@...@.@@@@@@.@.@@@@@.@.@@@@@.@.@@..@..@.@@@.@@..@@@@..@@@@@@.@@@@.@@@@..@@@.@..@..@@@ +...@@@.@..@@@@@.@@@@@@@.@.@.@....@@@@.@@@.@@@.@@@@@.@.@@@.@@@@@@@@.@@@@..@@.@@...@@@@@@@@@@@@@@@@.@@@@.@@@..@@@@.@@.@..@@...@@@.@@@@.@..@..@ +@..@.@@@@@@@..@@@@..@@@@..@.@@@@@@@@@@@.@@@@@@@@@@@@....@@.@@@@@@@@@@@@@@@@@.@@.@.@.@@.@.@.@@@@@@@@@@@@@@@...@@@@@.@@...@@@...@@..@@@@..@.@@ +@.@....@@@@@@@@@@@.@@@.@@.@@@@.@..@@@@@@.@@..@@@@@@...@.....@.@@...@@..@@...@@@@@@@@@@.@@@@@..@...@.@@.@@@.@@@@...@@@@@..@@@@..@@@@@.@@@@... +@@..@@@@@@@@@@.@.@@@....@@@@@@.@@.@@@@@..@@@.@@..@.@.@@@@@@.@@@@@@.@@...@@@@@@@@@.@@@@@..@@@.@@@.@.@@@@@@@@@@.@..@.@@@@.@@@..@@@@.@@@..@..@@ +@@@....@..@@@@@@@@@@.@...@@.@@@@@@@@@@@@@..@@..@@..@@@..@.@@.@@@@.@@.@@@@.@@.@.@@@.@..@@@@@@@@.@.@@@.@@@@@@@@.@@.@@@.@@@.@.@.@@@@..@@@.@@.@. +@@@@.@@@..@@@@@@@...@@@@@.@@@.@@@@@@@@@.@@.@.@@@.@@@.@.@.@@@@.@@@@@@.@@.@@....@@@@@@@@@.@@@.@@@.@@@..@@....@@@@.@.....@@@..@@@@@..@.@@.@@@@. +@@.@@@@.@.@@.@@.@@@@@@@@@@@.@.@@.@.@@.@@@@...@@.@.@@@@@@.@.@@@@@@@..@.@@.@@@@...@@..@@@@@@@@@.@@@.@@.@@.@.@..@.@@@..@@.@@@.@...@.@@.@@..@@@. +@@.@@@@@@@@@@@.@@@@.....@.@@@@.@@.@@@@@.@@@@...@@@.@.@@@@@@@@@..@@.@.@.....@@@@@@@@@@@@@@@@@..@.@@@.@@@@@.@@@.@.@@@@@.@.@.@@@@@@.@@@.@..@@.@ +@.@.@@@@@.@.@@...@@@@@@..@@.@@@@@@.@@..@@@@...@...@.@.@@@@@@@@@@@@@@...@@@..@.@@.@@.@.@@.@@...@@@@@..@@@...@.@@.@@@...@@@@.@@.@.@@..@.@@@@@. +@@@.@@.@@@@..@@@@@@.@@....@.@.....@@.@.@@.@@.@@@@@...@..@@...@@.@@@@@.@...@@@@.@@.@..@@.@.....@@@@@@@@@.@.@@@...@.@.@.@.@@@...@@@@@@..@@@@@@ +@.@.@@@@@@@@@@.@.@@@..@..@.@.@..@.@@@@.@@@@@@.@@@@@@...@.@.@@@.@.@@@.@.@@..@@.@@@.@.@.@@.@..@@.@..@@@@@..@@..@@.@@@..@..@@@...@@@@.@..@..@@. +.@@@@@@@..@@@.@@.@.@@@@.@.@@@@..@@..@@@..@.@@@.@@@@@@@.@@..@..@..@@@..@@@.@@@@.@@@.@@..@@@.@.@@@@.@@@@@...@.@@.@@.@@@@..@..@.@@...@.@@..@@.. diff --git a/2025/day-04/part-one.py b/2025/day-04/part-one.py new file mode 100644 index 0000000..c5b1161 --- /dev/null +++ b/2025/day-04/part-one.py @@ -0,0 +1,148 @@ +import logging +import sys + +# Logger setup +logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) +stream_handler = logging.StreamHandler() +logger.addHandler(stream_handler) + +def main(): + with open("input.txt", "r") as input: + matrix = getMatrixFromString(input) + output = getRollsFewerThan(matrix, 4) + logger.info("Output: " + str(output)) + +def getMatrixFromString(data): + output = [] + for line in data: + line = line.strip() + line_output = [] + for i in range(len(line)): + char = line[i] + if char == "@": + line_output.append(True) + elif char == ".": + line_output.append(False) + else: + logger.error("Unexpected char: " + char) + output.append(line_output) + return output + +def getRollsFewerThan(matrix, n): + output = 0 + for i in range(len(matrix)): + for j in range(len(matrix[i])): + if not matrix[i][j]: + continue + adj = 0 + # Si on est a la première ligne + if(i == 0): + # Si on est a la première colonne + if(j == 0): + if(matrix[i][j + 1]): + adj += 1 + if(matrix[i + 1][j]): + adj += 1 + if(matrix[i + 1][j + 1]): + adj += 1 + # Si on est a la dernière colonne + elif(j == (len(matrix[i]) - 1)): + if(matrix[i][j - 1]): + adj += 1 + if(matrix[i + 1][j - 1]): + adj += 1 + if(matrix[i + 1][j]): + adj += 1 + else: + if(matrix[i][j - 1]): + adj += 1 + if(matrix[i][j + 1]): + adj += 1 + if(matrix[i + 1][j - 1]): + adj += 1 + if(matrix[i + 1][j]): + adj += 1 + if(matrix[i + 1][j + 1]): + adj += 1 + + # Si on est a la dernière ligne + elif(i == (len(matrix) - 1)): + # Si on est a la première colonne + if(j == 0): + if(matrix[i - 1][j]): + adj += 1 + if(matrix[i - 1][j + 1]): + adj += 1 + if(matrix[i][j + 1]): + adj += 1 + # Si on est a la dernière colonne + elif(j == (len(matrix[i]) - 1)): + if(matrix[i - 1][j - 1]): + adj += 1 + if(matrix[i - 1][j]): + adj += 1 + if(matrix[i][j - 1]): + adj += 1 + else: + if(matrix[i - 1][j - 1]): + adj += 1 + if(matrix[i - 1][j]): + adj += 1 + if(matrix[i - 1][j + 1]): + adj += 1 + if(matrix[i][j - 1]): + adj += 1 + if(matrix[i][j + 1]): + adj += 1 + else: + # Si on est a la première colonne + if(j == 0): + if(matrix[i - 1][j]): + adj += 1 + if(matrix[i - 1][j + 1]): + adj += 1 + if(matrix[i][j + 1]): + adj += 1 + if(matrix[i + 1][j]): + adj += 1 + if(matrix[i + 1][j + 1]): + adj += 1 + # Si on est a la dernière colonne + elif(j == (len(matrix[i]) - 1)): + if(matrix[i - 1][j - 1]): + adj += 1 + if(matrix[i - 1][j]): + adj += 1 + if(matrix[i][j - 1]): + adj += 1 + if(matrix[i + 1][j - 1]): + adj += 1 + if(matrix[i + 1][j]): + adj += 1 + else: + if(matrix[i - 1][j - 1]): + adj += 1 + if(matrix[i - 1][j]): + adj += 1 + if(matrix[i - 1][j + 1]): + adj += 1 + if(matrix[i][j - 1]): + adj += 1 + if(matrix[i][j + 1]): + adj += 1 + if(matrix[i + 1][j - 1]): + adj += 1 + if(matrix[i + 1][j]): + adj += 1 + if(matrix[i + 1][j + 1]): + adj += 1 + + print("adj[" + str(i) + "][" + str(j) + "]=" + str(adj)) + if(adj < n): + print("Found one at [" + str(i) + "][" + str(j) + "]") + output += 1 + return output + +if __name__ == "__main__": + main() diff --git a/2025/day-04/pyproject.toml b/2025/day-04/pyproject.toml new file mode 100644 index 0000000..7d0689a --- /dev/null +++ b/2025/day-04/pyproject.toml @@ -0,0 +1,9 @@ +[project] +name = "day-04" +version = "0.1.0" +description = "Add your description here" +readme = "README.md" +requires-python = ">=3.10" +dependencies = [ + "logging>=0.4.9.6", +] diff --git a/2025/day-04/uv.lock b/2025/day-04/uv.lock new file mode 100644 index 0000000..64f9437 --- /dev/null +++ b/2025/day-04/uv.lock @@ -0,0 +1,20 @@ +version = 1 +revision = 2 +requires-python = ">=3.10" + +[[package]] +name = "day-04" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "logging" }, +] + +[package.metadata] +requires-dist = [{ name = "logging", specifier = ">=0.4.9.6" }] + +[[package]] +name = "logging" +version = "0.4.9.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/93/4b/979db9e44be09f71e85c9c8cfc42f258adfb7d93ce01deed2788b2948919/logging-0.4.9.6.tar.gz", hash = "sha256:26f6b50773f085042d301085bd1bf5d9f3735704db9f37c1ce6d8b85c38f2417", size = 96029, upload-time = "2013-06-04T23:43:22.086Z" }