add 2025 day 4 part 1
This commit is contained in:
1
2025/day-04/.python-version
Normal file
1
2025/day-04/.python-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3.10
|
||||||
0
2025/day-04/README.md
Normal file
0
2025/day-04/README.md
Normal file
10
2025/day-04/input-small.txt
Normal file
10
2025/day-04/input-small.txt
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
..@@.@@@@.
|
||||||
|
@@@.@.@.@@
|
||||||
|
@@@@@.@.@@
|
||||||
|
@.@@@@..@.
|
||||||
|
@@.@@@@.@@
|
||||||
|
.@@@@@@@.@
|
||||||
|
.@.@.@.@@@
|
||||||
|
@.@@@.@@@@
|
||||||
|
.@@@@@@@@.
|
||||||
|
@.@.@@@.@.
|
||||||
140
2025/day-04/input.txt
Normal file
140
2025/day-04/input.txt
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
@@..@.@.@..@@.@@@@@.@@@@@@..@@.@@.@@..@@@.@@@.@.@@@@.@@@.@@@.@..@.@@@@..@@@.@@..@@@.@@@..@@@@..@.@@.@@@.@..@.@@@.@@@..@@@.@.@@@@@.@.@.@@@@@@
|
||||||
|
@.@@@@@@....@..@@@.@..@.@.@@.@@.@@..@@@..@.@@..@..@@@.@@@.@..@.@.@@..@@.@..@@.@@@..@.@@.@.@..@@...@@@@@@@@.@@@.@@@.@@.@@@@@@@..@..@@@.@.@@.@
|
||||||
|
.@.@@@@.@@.@@.@.@.@@.@..@@.@@..@@@@@@@@@@@@...@@.@...@@@@.@.@@.@@@.@.@@..@@.@@.@@.@@..@...@@@@.@@@@@@@@@@@.@@@....@@@@@.@.@...@@.@@@@@@@.@@@
|
||||||
|
@@@..@@@@.@@@@@@@@.@@@@@.@@.@....@.@..@.@@@@@@@...@@@@@@@@.@@...@.@@.@@@@@@.@....@@.@@@.@.@@..@@@.@.@@@..@.@.@@@.@.@@@@@@@@...@.@@@@@@.@..@@
|
||||||
|
@.@@@@@.@@.@.@.@.@..@@@@.@..@...@.@@@.@.@@@@.@@.@@@@@@.@@@@@..@@..@.@.@@.@.....@@@.@@@.@..@@@.@@.@..@@@@.@.@@@@..@@@@@@.@@@.@@.@@..@@.@.@@@@
|
||||||
|
@@.@@@@@.@@@.@@@@@.@@.@.@@@@.@@...@.@@@..@@.@@.@@@..@@@...@@.@@@@..@@@@@@@...@.@@@@@@....@..@@@@@.@...@.@.@@.@...@@@@.@.@@@.@@.@.@@@@.@.@@@@
|
||||||
|
...@.@@.@@.@.@.@@@@...@@@@@@@@@.@.@@@.@@.@@@.@@.@@@@.@@@@@@@@@.@@..@..@.@@@@@@@@@@@@...@.@.@@@.@.@.@.@@@.@..@@@@@@@@@@@.@@.@...@@@@@@@@.@@@@
|
||||||
|
..@@@.@.@.@@@@@...@@..@@..@@.@...@@@.@.@.@.@.@@.@.@@@.@@.@.@@@@.@.@@@@@@@.@@.@.@@@@@@.@.@@@@@@@@@@@.@.@@@@@.@@@@@@@@@.@...@@@.@@@@.@..@@@@..
|
||||||
|
.@@@@.@@@.@.@@@.@@@..@@..@@@@@@.@..@.@@.@.@@@@@..@@@@@@@@.@.@@@.@@@@@.@.@@@@...@@.@@@.@.@@@@@@.@@.@.@@@@.@.@@@.@.@@@@@.@@@@...@@@@@@@@@@.@..
|
||||||
|
@.@....@@.@..@@@.@.@..@@@@.@.@@.@..@@.@.......@.@@@@@@@.@@@@@@@@.@@@.@.@@.@@@@.@..@.@@@@@@.@@@@....@@.@@@@.@..@@@.@@.@.@@@@@@@@.@@@@.@.@@..@
|
||||||
|
@@@@@.@@.@.@.@@.@..@@@.@.@@@@.@@@.@.@.@@@.@.@@@.@@@@@..@@@@@@..@@@@@@@@@@@@@@.@@@@.@@@@...@.@@@@..@@@@@@@.@@@@.@@.@@@@@@.@@@.@.....@@@@@@.@.
|
||||||
|
@.@@...@@@.@@..@@@@..@@.@@.@...@@@@@...@@@@.@@@.@@.@..@@@@..@.@@@@..@@@.@..@@@@..@.@@.@.@.@@....@.@@..@@.@@..@@@@...@@.@..@@@@@@@...@@@..@.@
|
||||||
|
...@.@...@@@..@..@.@@@@.@.@....@@@@@@.@..@@@@@.@@@@@@@@@@.@@@@@@@@.@@..@@@@@@@@@@@@@@.@.@...@@....@@.@@.@@@.@@@@@@.@.@..@@@@@@.@.@.@@..@@@@.
|
||||||
|
@@@@.@@@@.@.@@.@.@..@@@..@@@.@@@@@..@@@@@@.@...@.@@@.@.@..@@@@@@.@@.@@@.@@..@@@@@@@..@@@@@@@@..@@..@@@@@..@.@.@@@.@@..@.@.@@@@@@@.@.@@@.@@@.
|
||||||
|
@@@@@@@@.@@@@@@@.@@@.@.@.@@.@..@@@@@@@.@@..@@..@.@..@.@@@@@@..@.@.@@.@.@@@.@.@@@@..@@@@@@@@....@.@.@@@@@@@@@.@@@..@@@@@@..@@@@...@@@...@.@.@
|
||||||
|
..@@@..@.@@.@.@@...@@@..@.@@@...@..@@.@@@@@..@@@@.@@@@.@@@.@@.@@.@@@@@@@..@.@..@.@.@@@..@@@@@...@@..@....@......@.@.@.@.@@@.@.@@@@@@@.@@.@@.
|
||||||
|
.@@.@@@@@.@..@@@@@@.@....@@@.......@..@@@.@@@...@..@@..@@@@..@.@@@@.@@.@@..@@.@.@@@@.@@.@@.@@@@@...@@@@.@@@..@.@.@@@.@.@@.@@@..@@@..@@@@@..@
|
||||||
|
@.@.@..@.@.@.@@.@@@@@@@@@@@@.@@@@.@@..@.@.@@@..@@@@.@@@@@...@.@@.@@@@@@@...@@..@@@@..@@....@.@@@.@.@@@@@.@@@@@@@..@@@@@@@@@.@@@@..@@@.@....@
|
||||||
|
@@..@@.@@.@.@..@@...@.@.@.@@....@@@@@@.@.@@@@@@.@..@@@@@@.@@@@..@.@.@.@.@.@@.@@...@@@.@.@@.@@.@@@@@@@.@..@@.@.@.@@..@.@@@@@@@@.@@@@..@@...@.
|
||||||
|
.@@..@@@@@@@.@.@@@@.@@@@@@@@.@.@@@@@@@@@.@@@@@.@@@@..@@@@..@.@@@@.@.....@.@@.@@.@@@@@..@@@@@.@@@@@.@@@.@@.@@@..@@@..@@@@.@@.@@@@@@@@@@@@.@@@
|
||||||
|
.@..@@@@@@@@@@@.@@.@@.@..@..@@@...@@..@@@.@@.@.@@.@.@..@@.@@.@@@@@.@@@.@.@@@@.@@@@@.@...@@.@@.@.@@..@@@.@@@@@.@@@@@.@....@@@@@@@@.@@.@@@@@@@
|
||||||
|
@..@@..@@@@.@@.@.@.@.@.@@@@..@@.@..@.@@@@@@@.@@..@@@@@.@@@.@@@.@.@@.@@.@@@.@@@@@@@@@@@@@.@@@@@@.@@@@@@@...@@@@@@@.@@@@.@.@.@@@.@@@.@..@@@..@
|
||||||
|
@@@@@@@@.@.@@..@.....@.@@@...@.@@..@@@..@..@..@@@.@@@@@@@@.....@..@@.@.@.@.@@@@.@@.@@.@@@@@@.@.@.@@.@@@@@.@.@@@...@@.@@@@@@@...@.@@.@@@..@.@
|
||||||
|
.@@@@@@..@.@@...@@@@@@@@@@@.@@@@@..@...@.@.....@@@.@.@@@.@@...@.@.@.@@@@@@.@@@@@@.@@@@@...@@@@.@..@@.@@@.@@.@.@@@..@@@@@@@@.@@@.@@..@.@.@.@@
|
||||||
|
@.@@.@@@.@.@.@.@@@@@@@@.@@@@..@.@@@@@.@@.@@....@..@@.@..@@@....@@..@@.@@@@@@@@@....@@.@@@.@@..@...@@@@@@@.@@@@@.@@@.@@@@@@@@@@...@@.@.@@@@@@
|
||||||
|
@@@@@@@@@...@.@.@@@.@@.@@.@.@..@..@..@..@.@.@@@.@@@@@@@@@...@@@@@@@@@@.@@@.@@.@@...@@@@@@@.@.@@.@@@@@.@.@@..@..@....@.@@@.@...@..@..@@.@@@@@
|
||||||
|
@@@@@@@@...@@@.@@@....@@@.@..@@@@.@@@@@..@@@...@@.@.@@@.@@.@.@@.@.@@@@.@@.@@@@@@@@@@@@..@@....@@.@@@@@.@@@@@....@@@....@@@@@.@.@@.@@..@@@@@@
|
||||||
|
.@@@@.@@@@....@..@.@@@@@.@@@@@@..@..@@.@@@@.@@@..@@@...@.@@@.@.@@@@@@@..@..@...@@@.@@@.@@@..@@@@@...@...@..@@@@@.@@..@@...@@@.@@@@@.@@@...@@
|
||||||
|
@..@@@...@@@.@.@@@@.@@@@@@.@@@@.@@.@@@@@@@..@@@..@@@@.@@@@..@@@..@.@@@...@@.@@@@..@@@@@@@@.@@@.@@...@@...@.@..@.@.@@.@.@@@@.@@.@..@@..@..@@.
|
||||||
|
@@@@@@@..@@..@@.....@@..@@@..@@@@@..@@@@@.@@@@@.@..@@@@..@.@@@@...@..@@@.@.@@@..@@@..@@@@@..@@@@.@.@.@@.@@@@@@...@@@@@@@@@@..@@.@.@@.....@@@
|
||||||
|
.@@@@......@@@.@@..@@@.@..@.@@@@@@.@.@..@@.@@@.@@@@....@@@@.@@.@@@@@@@.@.@@@..@@@.@@@@@@..@@@.@@@@.@@@@@.@@@@@@@.@@.@@@@@@.@@@@@@@@@.@..@@@@
|
||||||
|
....@@@@@.@.@@@@@@@@@.......@.@@@@@@..@@.@@@@.@@@..@@@.@..@@@.@.@@.@@@.@@..@@@.@@@@@@@.@.@@@@@@...@@.@..@.@@.@.@@.@@@@@.@@@@@.@..@...@@@.@@@
|
||||||
|
@@@@@@@@@@@@.@@.@@@.@@.@@.@@@..@@@@@.@@@.@..@.@.@@.@@.@@@@@..@@.@@..@....@..@...@@@@@..@..@.@.@@..@...@@@@..@.@@@@@@@@.@@@@@@@@@.@..@.@@@@@.
|
||||||
|
@.@..@@@@..@@.@@.@.@@@@@..@@@@@@@....@@.@@..@@.@@@@...@@@@.@@@@@@@@@@.@.@@.@..@.@@@@@@@@.@@@..@@..@..@@@..@@@@....@@@@@@.@@..@@@@@@@@@@@@@@.
|
||||||
|
.@@.@.@.@@@@@@.@@@.@@@@.@..@.@@.@@@@..@@@@@@.@@@.....@.@.@....@.@@@@@.@@@@.@@@@@@@@@@.@@@.@@@@@@@..@@..@@.@...@.@@@.@.@.@@.@.@@@@@@..@@@@.@@
|
||||||
|
@.@@.@@@@@@@@@.@.@@.@@@@@@@.@@....@@.@@.@@@@@.@@@@.@...@@.@@@@.@@@@@.@..@@@@@@@.@@..@@@@@..@@.@...@@.@@.@@@@.@@@@..@..@@@@@.@@@.@@.@@@@@...@
|
||||||
|
@.@@@.@.@..@.@@.@.....@.@.@@@@@@@@@.@@@@@@@@@@.@..@.@@.@@...@@@.@.@@.@.@.@@.@@@..@@@@@@.@@@@@@@@@.@....@.@@@@@@.@@@@@.@@.@.@@@@@@@.@@@@@@@.@
|
||||||
|
@.@...@@@...@@.@@..@@..@.@.@@..@.@.@..@..@@@@@@@..@@@@@@@@@@.@@.@@@.@@@@..@..@.@@..@@@.@.@.@@@.@.@.@@@@@@....@.@@@@@@@@@.@@@@@@..@@@.@@@.@@@
|
||||||
|
.@@@@.@@@.@.@.@@..@@@.@@@@..@@@.@@.@@@..@@@.@@..@.@@@@@@..@@@@@.@@@.@@..@.@.@@@@...@@.@...@.@@@.@@@@.@@@.@..@@@@..@@@..@@.@@.@.@@.@.@.@@.@@@
|
||||||
|
..@@@@..@@@..@.@@@@@.@..@.@@.@...@@@@@@@@..@.@@@@@@...@@@@.@.@@@....@...@@.@..@@@@@.@.@.@.@@.@@@@@.@@@@@..@@@@@@@..@@.@@.@@..@...@@@@@@@.@.@
|
||||||
|
.@@@@.@@@@.@@@@@..@..@@..@.@.@@....@@@@.@...@@@@@@@@..@.@..@.@@@@@@@@@@@.@.@@..@.@@.@.@@@@@@.@@@.@@@.@@@..@@..@@..@.@@...@@.@..@..@.@@@.@.@@
|
||||||
|
.@@@@@@@@@@@@.@@@.@@...@..@..@..@.@.@@@.@..@.@@...@@.@@..@@@@@@..@@@@@@@.@.@@@@@.@@.@...@@.@@.@@@@@@.@@@.@.@@@@..@...@@@@...@@.@@@@@@@@.@@.@
|
||||||
|
.@@@@.@..@..@.@@@@@.@.@@@@.@.@.@.@..@.@@@@..@@@..@@..@..@@@@@.@.@@@@...@..@....@..@@.@...@@.@.@@@.@@@@.@@@.@@@@@....@@@@.@@@.@..@@@@@@@..@.@
|
||||||
|
@@@@@@@@.@@@...@@..@.@.@.@@.@@.@@..@@@..@@.@@@@@@.@@.@@...@.@@@@..@@@@@..@@..@.@@@@@@@@@..@@...@@.@@@.@@@@@@@.@@..@@.@@@@.@...@.@.@..@@.@.@@
|
||||||
|
@.@@@.@.@@@@@@@@@@@..@@...@.@@@..@@@@@..@.@@@..@.@@@@.@@@@@@@@@.@.@@@.@@@@@@@..@.@@...@@@..@@.@.@@.....@@@.@@.@..@@.@..@@@.@.@.@.@@@.@@.@@@@
|
||||||
|
@.@.@....@@@.@@..@@@.@@@@@@@.@.@@.@.@@@@@@@.@@.@@@@@.@.@@....@.@@@..@@@@@.@@@@.@.@@@.....@@@@@@@@@@..@..@@@@@@..@.@@@@@@@.@.@@.@@@.@@@@.@.@@
|
||||||
|
.@@@@.@@@.@..@@@.@@@.@..@@.@@.@.@@.@@@.@.@@@@@.@@.@..@.@.@@@@.@@@.@@.@@@..@.@.@@@..@@@@@@@@@@@.@@@@@@@@@.@@@@@@..@@@...@@@.@@.@.@@@@@@.@@@@@
|
||||||
|
@@.@.@@@@@@@@@..@@...@@@@..@@@.@@.@.@.@@....@@..@@.@@..@@@.@@.@..@@.@@@@.@@@@@@@@.@@@@@@@@@..@.....@@@@....@@@@@...@...@..@@@@@.@@.@....@.@@
|
||||||
|
.@@.@@...@@@@@@.@@.@@@@.@.@@@@.@@.@..@@@@.@...@@@@.@.@....@.@@@@@@@@@.@@..@@.@.@@@@@@.@.@@.@.@@@@@@....@.@@@@@.@.@.@.@@@@..@@@@.@.@..@..@@@@
|
||||||
|
.@@@@@.@@@.@.@@...@@..@@@..@@...@@@@..@...@.@...@@.@.@@@@...@@@..@@@@@@@@@.@@.@..@.@.@@.@@@.@@@..@@@@...@@@@@@@..@.@@@@@@.@@.@.@@@@.@...@@.@
|
||||||
|
@@..@.@.@@.@.@@.@.@@@..@@...@@@@@@@@@@.@.@@@@@@.@.@.@@..@@@..@...@@@@..@......@.@.@..@.@.@.@.@@@@.....@.@.@.@@.@@.@.@@@@@@.@@@@@..@.@.@..@@@
|
||||||
|
.@@@@@@@@@@.@@@@..@.@.@.@@@@@@@@.@@@.@@.@@..@@..@@@.@@..@.@.@.@@@..@.@.@@@.@..@@@.@@.@.@..@@@...@.@@@@...@@@.@.@@.....@@...@.@@.@@@@@.@@@@@.
|
||||||
|
.@@@..@@@@@@@.@@@.@@@@..@@@..@..@@@..@@@..@@.@@.@@@@@@@.@.@@@.@.....@@@@@.@@.@@..@@@@.@@....@@@..@@@@.@@@@@@.@@.@..@@@.@..@@..@..@@.@@@.@@..
|
||||||
|
@@@@@@..@.@@@@@.@@@@.@..@.@@@@@..@@@@..@..@@@@@.@@@@@@@.@..@@..@@@@@@@@..@@@@.@.@@.@@...@.......@@.@..@@@@.@..@@@@...@.@@@.@......@@...@@@..
|
||||||
|
@.@.@.@....@.@.@@.@@@@@@@.@..@.@..@@.@.@.@@@@@@..@...@...@.@.@.@.@@@@@@@@@..@@@.@@@@@@@@@.@..@@@@@@.@@.@@@@@@.@@.@@...@@@@@@.@@@.@@.@..@..@@
|
||||||
|
.@@@.@@@@@@@@.@@@.@..@@.@..@..@@.@@@..@@@@@@.@@@@..@@....@@@@.@.@@.@@.@@@..@@@@@@@....@..@@.@@@@@..@..@...@@.@@@@@.@@.@@@@.@@@@@@.@..@.@@@.@
|
||||||
|
@..@...@@@@..@@..@@..@@@.@.@@@@.@..@@@.@.@.@@@@@.@@...@..@@...@....@.@.@@@@@.@@@.@@..@@.@@@.@.@@..@@@@..@@@@@@@@@.@@@@@.@@.@@.@.@@.@.@.@@@.@
|
||||||
|
@.@.@@@.@..@.@.@.@.@@@@@@@.@.@@.@..@@@.@@@@@@@...@@@.@@@.@@@@.@@@....@@@@@@@.@@.@.@@...@..@@.@..@.@@.@.@@@@..@@@.@@@@@@..@@@..@.@@@@@@@@@@.@
|
||||||
|
.@@.@@@@..@..@@.@.@.@@.@@@@..@@.@....@@@@.@@@.@@@.@@@@@@@@.@@.@@@.@@@@.@@@@@@@@@.@@@@..@@.@..@@@.@.@@@@@@@@@@@.@@.@.@.@...@@@@@.@@.@...@@@@@
|
||||||
|
.@..@@...@@.@@@@@@@@@@.@@@.@@.@@@@@@@.@@.@@@@.@@..@@.@.@@.@@@.@@@@.@.@@@@..@...@.@...@@@.@@@@@..@@@@@@@..@.@@@.@.@.@.@.@@.@@@@..@.@..@.@.@@.
|
||||||
|
.@..@...@.@@.@..@@@@@@..@.@@@@@@...@@..@@.@@@@.@....@.@@@..@@@@..@@.@.@..@.@@.@.@.@@@.@..@.@@@@@@.@@@.@@.@.@..@@.@@.@.@@@.@.@.@.@@@.@@@.@@..
|
||||||
|
.@@@.@.@..@..@@@..@@@.@@.@.@@@.@@@.@@@.@@@..@@@@@@..@@@@@@@.@@@@.@.@...@@@@@@@.@@@@...@..@@@@.@.@@@......@@@.......@@.@..@@@@@..@.@.@@@...@@
|
||||||
|
.@@@@@@.@@@.@@@@@@@.@@.@@.@@@@@..@.@.@.@..@@.@.@.@@@.@.@@@.@@@.@@.@@..@@@..@@@@...@@..@.@.@@@..@@..@.@@@.@..@.@@@@@@@@@...@@@@.@@@@@@@.@.@.@
|
||||||
|
@.@.@@.@@@....@@@@@@@.@@@...@@@..@.@@@@@@@@@@@@.@.@@@@@.@@@.@@.....@.@@@....@.@@....@@@@@@@.@@@@@.@@@.@.@.@@.@@@@@@@@..@.@.....@@@@@..@@@@.@
|
||||||
|
@....@...@.@.@..@@@@@......@.@...@.@.@..@@.@@@@@@..@@@@.@.@.@.@.@.@...@@@@.@@@.@...@...@@@...@@@@@@@@@@@..@@@..@.@@@@@@.@@@@@....@@@.@@.@..@
|
||||||
|
@@@@.@..@@@.@@@..@@.@@@@@@.@.@.@.@@@@@@@.@.@@.@@@.@@...@@.@.@.@@..@@@.@@@@@.@@.@.@@@@@.@@@@@@.@@.@@@@@.@.@@.@@....@@....@....@@@@.@@.@@@..@@
|
||||||
|
@.@@@@@@@@@..@@@@@..@.@@.@..@@@.@@@@@@@@..@@@@@..@@@.@.....@@@..@.@@@@@@..@@..@@@.@.@..@.@@.@@@@@@.@.@@.@@@.@@.@@.@..@.@.@@@@..@.@@@@..@.@.@
|
||||||
|
@@@@@.@.@.@@...@@...@@@@@@@@.@..@..@@@@..@@@..@.@@.@.@@@.@.@@@...@.@@@..@@@@@@@@@....@@@@@.@@@.@@..@@...@@@.@.....@@..@@@@@@@@@..@@@@@.@@@@@
|
||||||
|
@@@..@@@.@@@@@@@@@@@@..@..@.@@.@@@@@@@@@@@@@.@@@@@@.@..@.@@@@@@@.@@@@@.@@@@@@@...@@@@@...@@.@.@@@@..@@@@@@.@@@@@..@@@@@@.@...@..@@@.@@.@.@@.
|
||||||
|
.@@..@@@@@.@@.@@@@@@.@@@.@@.@.@@@@.@@..@@@....@@@@@@@.@@....@@@@@@.@@.@@...@..@@@@@@..@.@.@@@@@@@@@@.@@@@.@@@@.@.@@@@...@.@.@@.@.@@.@.@@@@..
|
||||||
|
@.@@.@@.@@@@@@@@@.@@@@@@@.@@@..@..@.@...@..@..@.@....@@.@@.@@@@.@.@@.@@.@@.@.@@@@@@@@@@@.@.@@@..@@@..@@@.@@@@@@@@.@.@@@@@@@.@@.@..@@@@@@@@@@
|
||||||
|
..@@..@.@@@@@.@@@.@@@.@.@@@@.@.@@@@@@@@@@@@@.@@@@...@@@@@@@@@@.@.@@.@...@@@@@..@@.@@@@..@@@...@..@@@.@@@.@@@..@@@@.@.@@.@@@.@.@.@.@@@.@@.@..
|
||||||
|
@@..@@@@@...@@@.@@@@.@...@@@@@@@.@@@.@...@@@@@@@..@..@@@@@.@.@@.@.@@.@.@.@@@@@@...@.@....@@@..@.@@@@@@@@@@@@.@..@@@@@@@@@.@@.@@@@@..@@@@.@@.
|
||||||
|
@.@@.@@..@...@@@@@@..@.@@...@@.@@@@@@.@.@...@@.@@@.@.@@@@@.@@@@@.@.@@@.@.@@@@@@@@@.@@@.@.@@@@@@@@@@@@.@.@@@.@@.....@.@@@@@@@@@@@@@@@..@...@@
|
||||||
|
@.@.@.@.@.@@...@@@@@@.....@.@.@..@..@@@@@@@..@@@@@@....@@.@..@@..@.@@..@@@.@@.@@.@@@@@.@....@@@@....@.@@@...@..@...@@.@@@@@@@@@@.@@...@@@@.@
|
||||||
|
@@@.@@@...@@@.@@@@@@@@.@.@@...@@@@..@..@@@@@..@@@@@@@@@....@@@@@.@@@....@.@.@.@.@@.@@@@..@@@.@@..@.@.@@@@@@@@@@@@@@@@.@.@.@@@@@....@..@@.@@@
|
||||||
|
...@@@.@@.@@.@@.@@...@.@.@...@@.@@.@@.@..@@@@.@@.@@@@.@@.@@..@@@@...@@@@@.@..@.@@@@@@..@@..@@@.@.@.@@..@@@@@@..@@..@.@@@@@@@@.@...@@.@@.@@.@
|
||||||
|
@@@@..@@.@@..@.@@@@@.@.@@@@.@@..@..@@.@.@@@@..@@@@@@@@@@@@@.@.@@@@.@.@@@@@@.@...@@@@.@.@@...@.@@@@.@@@..@@@..@.@@@@@..@.@@.@@.@@@@@@@@.@@@@.
|
||||||
|
@@@..@@..@@@@@.@@.@..@@@.@..@.@@.@@..@.@.@@.@....@@@...@@@.@@@..@.@.@.@@@.@.@.@....@@....@@@@@.@@@@@@@.....@@..@.@@@.@@@@....@@..@@@.@@.@.@.
|
||||||
|
@@.@..@@@@@@@.@.@@.@@@.@@@.@@.@@@@@@@@@@.@@@..@.@@@@..@@.@@.@.@.@@@.@.@@@@@@......@@@..@@@.@.@@.@@@@..@@.@@.@.@@..@.....@@@@@.@.@@.@.@.@.@.@
|
||||||
|
@@@.@@@@..@.@@.@@@.@.@@@.@....@.@.@@..@..@@.@@@@@@.@@.@@@@.@@@@@@@@@@@@@..@.@.@@..@..@@.@@@@.@@.@@.@@..@@@@@@.@@@@@.@@.@@@.@@.@...@@.@@.@.@@
|
||||||
|
@.@@@@@@@..@.@@@.@.@@@.@.@@@@@..@@@@@...@@@@.@@..@@.@.@...@@@@@@@@@@@.@@@@@@...@@@@@.@@@@@..@@@.@@.@..@.@@@@.@@.@@@.@@@.@@@.@.@@@@@@@@@..@@.
|
||||||
|
@.@@.@..@@.@@@@@.@@.@@@.@..@..@@@.@.@.@@@@@.@@..@.@@....@@@@@.@..@@.@@.@@.@@.@@.@.@@.@@@.@@@.@@.@.@@@.@@@@@@@..@@@.@.@@.@.@@.@@@.@@...@.@@@@
|
||||||
|
@@......@@@@@.@.@.@.@@@@..@@.@@@@@@@@@.@@@@.@@@.@@@.....@@@@@@@@..@@@@.@@...@@@@@@@@..@.....@.@@@..@.@@@@@@@@@.....@@@@@@@@.....@@.@@..@@.@.
|
||||||
|
@@@...@@.@.@.@@.@@.@..@.@@.@@@@@..@..@.@@@@@@@.@@.@@@..@..@.@@@@.@@.@@@@@@@@@@@.@..@@@@.@..@@@@@.@.@@@@@@@@@..@@.@@@@...@@@@@@@.@@..@@.@@@@@
|
||||||
|
.@.@@@.@@@@.@@.@@@@@...@@..@@@@@@@@@.@.@@..@.@@.@@@.@@@@@@.@@@@...@@.@@@..@...@@.@@@@.@....@@@.@....@....@@@@@@.@@@..@@.@@..@@...@@@..@.@@@.
|
||||||
|
.@....@.@@@@@@@@@@...@@@@.@.@.@.@@@.@@@@@@@@@.@@.@@@..@.@.@@@@.@...@@@@..@.@@@@..@@.@@@@.@@@@@@.@@.@.@@.@..@@@@@@@@@@@@@@@@.@@@@@@.@.@.@.@..
|
||||||
|
..@@@.@..@@..@@@@@@@..@@@.@@@@..@@..@@@@.@@@@..@@@.@@@.@@@@..@@..@.@.@.@@@@@@@...@@.@@@@@@.@@.@@@.@@@.@@@@@@@@.@.@@@@@@@@@.@.@....@@.@@@@@@.
|
||||||
|
@.@@@.@@@@@.@@@@@.@@@...@.@@.@@@@@@.@..@.@@@@@@.@@.@@@@@@.@@@@@.@@@@@@...@@..@@@@@..@.@@@.@.@@.@.@.@@.@@@@.@.@..@@@.@.@@@...@@@..@@.@@@@@..@
|
||||||
|
@@@.@@@.@@..@..@@@....@.@@@..@....@.@.@@@.@....@@@..@@.@@@@.@.@@...@..@.@@@.@@@@@@@@@..@.@@...@@@.@@@@@...@@....@@@@@@.@....@@@.@@.@@..@@@@@
|
||||||
|
@.@..@...@@..@.@@@..@@@@@@.@..@@@..@@@@@.@@@@@@@.@..@@@@...@@.@@@@.@@@@@.@.....@@@@@.@@@@@.....@@.@..@@.@@@@@.@@.@@@@@.@@.@@.@@.@.@@..@.@.@.
|
||||||
|
@..@@@@@@.@@...@.@..@@@@.@@@.@@@@@@@@.@..@@@@...@@@@@@@.@.@@.@@@@..@....@.@....@...@@.@@.@.@.@.@.@@.@@.@@.@@@..@@@@.@@@@.@@@.@.@@...@..@@...
|
||||||
|
@@@@@@.@@@@@.....@@@@@@@@@@@..@.@@@@@@@@..@...@.@@.@@@@.@@@.@@@.@.....@.@@@.@@..@@@@...@@..@.@@@@.@@.@@@@..@@.@..@@@@@@@.....@@.@...@@..@.@.
|
||||||
|
@@@.@@@@..@@.@.@@@@..@.@@.@@..@@@..@@.@@.@@...@@@@@..@..@@@@.@@.@@@@@.@@@..@@.@@@@..@.@.@...@@.@@@@@@..@@@@@@@..@@@@@@@.@.@.@.@.@...@@@.@@.@
|
||||||
|
@@@@.@..@@.@.@.@@@.@..@@.@@@@@@@..@@@@@@@@@@@.@@@@@@.@@.@.@@.@@..@@@.@@@@@.@@.@..@@@.@@@@.@@@....@@@@@@@.@....@.@@@@@@@.@@@@.@@@...@.@@.@@@@
|
||||||
|
@@.@.@@...@@@.@@..@@.@@@@.@@.@@.@..@.@..@@@@@@..@...@@..@@@.@.@@@@.@@.@@@.@.@@.@.@@@@@...@.@.@@@..@@@@.@@@@@.@...@@@.@@@@.@@.@...@.@@@.@@@.@
|
||||||
|
@.@.@..@@@@..@@.@.@..@@@@@.@@@.@....@@.@..@@.@.@..@@..@....@@@.@@@..@@.@@@@@@.@.@.@@@@@.@@..@.@@.@@@..@@@.@@.@@@@..@@@@@@@@@.@@@@@@.@@@@.@.@
|
||||||
|
.@.@@.@@@.@..@@..@@..@@@.@.@@.@@.@@.@....@@.@@.@.@@@@@.@@@.@.@....@.@@@.@@@@@@@@@@.@@@..@@@@....@@.@@...@.@@...@.@@....@...@.@@.@.@@..@.@@@@
|
||||||
|
.@@@@@@.@@@@@@@..@@@@@@@@@@..@..@@@@@@@@@@....@.@@@@@@.@@@@@@@@@.@@..@.@...@......@.@@@@@.@.@.@@.@@....@@..@@@..@@.@@.@..@@@.@@...@@@@@@@@@.
|
||||||
|
@@@.@@@@@@.@...@.@@...@..@@@@.@@@@@..@.@@.@@@@@@@....@@@.@.@@.@..@.@.@@.@.@@..@.@@@@.@....@...@@@.@@@@.@@@@@@@@.@...@@@@@@@@@@.@@@..@.@..@@@
|
||||||
|
@@@@.@@..@..@@@@.@.@@@..@@.@@@.@@.@@.@@@..@@@@.@@@@@@.@@..@.@@@.@.@@...@..@@@...@.@@.@@.@.@@@@.@.@...@@@.@@@.@@.@.@@.@@.@@@@@@.@@@@.@@..@@@@
|
||||||
|
.@.@.@@@@@@@@@.@...@..@@.@@@@@@@@@.@@@@.@@..@@.@@.@@@@.@@@@@@@..@@..@...@@.@@@@@@@@@.@@@@@@@@@@@@....@.@@@.@.@@@..@@..@@.@@.@@.@..@@.@.@@@@@
|
||||||
|
.@@.@@@....@@...@@.@@@.@@...@@..@@.@@..@@@@...@@@@@..@@.@..@.@@@.@.@..@..@@@@.@@..@@......@.@@@@@@.@....@.@.....@@@.@@.@@@@..@@.@@@@..@@..@@
|
||||||
|
..@.@@@@@.@@.@..@..@@.@@@@.@@@...@..@@@.@..@@@.@@@.@@...@@@@@@.@@.@.@@@@..@@@@@.@@@.@.@@@@@...@...@@@@.@@@@@.@@@@@@.@@@.@@@@@@..@....@.@....
|
||||||
|
......@.@@@@@@@..@@@..@@@@@.@@@.@@@.@@.@.@.@@..@@@@.@.@@...@.@@@@.@@.@.@.@@@@@.@@@@@@@...@@.@@@@@..@@@.@@@.@.@@@@...@@@@@@.@@@.@@@@.@..@@@.@
|
||||||
|
@.@@@@.@@.@@.@.@@.@@@@@@@@@@@@@@@@@@@@@@.@@@@.@.@.@@@@.@..@@@..@.@..@@@@@..@@@@@.@..@@.@@@@@@.@@@@@@.@@.@@@@@.@@@.@@@@.@.@@@@@@..@@.@@..@@@@
|
||||||
|
.@@@@.@@@@@@@@.@@@@@.@..@.@..@..@@.@@@@@...@@@.@@@@@@.@@@@@@@@.@.@@@@..@@..@@@.@@@@@@.@.@@@@@@@.@@@.@..@.@@.@.@..@@@.@@@@@.@@@@@...@@@.@@.@.
|
||||||
|
@...@@@@..@@.@@@.@@@.@@@@@.@@@....@@@@@@@@@@.@@..@.@.@.@.@@..@.@@@@@.@@.@.@@@@@.@@@.......@..@@......@@..@@.@@@.@@@@@@.@.@@@@@.@@@@.@@@@..@.
|
||||||
|
.@@....@..@.@.@@@@@@@@@@@@..@@@@.@@@@@@@@@..@@.@.@@@@.@@.@@@@@@@.@@@..@.@.@@@@.@.@@@@@@@@.@@@@..@@@..@@@.@@@.@@@@......@@.@@..@@.@@@@.@...@.
|
||||||
|
@@@@@@@@@@@@@@@@@@.@@.@...@@.@..@@.....@@@@@@..@@.@.@@..@..@@@...@@....@@@@@.@@@@.@@.@@@@.@..@@.@@.@@@.@@@......@...@...@@@@@@@@@@@.@@@@@.@@
|
||||||
|
@@...@@@.@@.@.@.....@.@@@@@@@.@.@.@@@..@@@@@..@@.@@@@@@@@@@@@@@@.@@..@@@@...@@@.@@.@@.@@@@@.@..@@@.@@@@@..@@....@.....@@@..@@@@@@@@....@@@.@
|
||||||
|
@@@@.@.@@@@@@@@..@..@.@@@@.@.@@..@@@@@@@.@@@@.@..@@@@@.@.@.@@@@@@..@.@.@...@@@@@@@@....@.......@...@@@@@@@.@.@..@@@@@..@@@@@@.@@@@@@.@@.@@@@
|
||||||
|
@.@@@@@.@@@@..@..@.@@..@@..@@@..@@.@@...@@@.@.@@.@@@@@@@@@@..@@.@@@@@@.@@@..@@.@@@@@@@.@.@@..@.@..@@.@@@@.@@.@@@..@@.@@@.@..@@@@.@@@@.@.@@@@
|
||||||
|
.@@@@@@@....@...@.@.@@...@@@@....@..@.@@@@.@.@@@@@.@@.@.@@@....@@.@@.@.@...@@.@...@.@....@@@.@@.@@@@.@@@.@.@.@.@@.@@.@@@@.@@@@@@.@@@@.@@@@@.
|
||||||
|
@@@.@@@@.....@.@.@@@.@@....@@..@@.@@@@.@@.@@.@.@@.@@@@@@@@@@@@@@@..@..@@@@@@..@@@.@@.@..@...@@@.@@@@.@@@.@...@@@@@@@.@@@.@@.@@.@.@@@@@@@@.@@
|
||||||
|
..@@@.@.@@.@@.@@.@@.@@...@@.@@..@.@.@.@..@@@@.@@..@@@@@@@@.@@@@@@@@.@.@.@@.@.@@..@@.@@@@@.@@@...@@@.@.@..@..@@@@@.@@..@@@@@@...@.@...@@@@@@.
|
||||||
|
@@.@.@@..@@@@@@@.@.@@@@.@.@.@.@@@.@.@@@..@.@.@.@@.@@@@@@@@..@.@@.@....@.@@@@@@@@@@..@..@@@@@@@..@.@@@.@@@@@@@.@@..@.@@@@@@...@@@...@@@@@...@
|
||||||
|
@@@@@...@@@@..@@@@@@@@@@.@@@.@@@@@@.@.@@.@@...@..@.@@@...@@@..@@.@.@@@@@@@@@@...@@.@@.@@@.@@@.....@@@@@.@@@@@@@@.@@@...@@.@@..@.@@@@@@@.@@@@
|
||||||
|
...@@@@@.@.@.@.@..@@@@.@@@@@@@@@@...@.@.@@@...@@@..@@@@@.@@@@@@@@@@@@@.@@@@@@.@...@@@@.@@@@@.@.@@.@...@@.@@.@@@@@@@@@@@@@.@@..@.@@@@.@@@.@@@
|
||||||
|
@@.@@..@@@@.@@..@@@.@@.@.@@@@.@@@.@@@..@@....@@@@..@@@...@@@.@@@.@.@@@.@@..@@@@@..@..@@..@@..@.@..@..@.@@@@.@.@.@@@@@@@.@@.@@@@@@..@@..@.@..
|
||||||
|
@@@.@@.@@@.@@@.@..@.@@...@@.@@@.@..@.@@.@....@@@.@.@@@.@.@@.@@.@@.@@.@.@.@@.@..@.@.@@.@@.@@.@.@@@@@...@@@@..@@.@@..@.@@@@@@..@@@@.@@@@..@@..
|
||||||
|
@@.@.@@@@@@@@@@..@@..@..@@@@@..@@@.@.@@@.@@@@.@@....@@.@.@@..@@.@@@@.@@.@@@@.@@.@@.@@@@.@...@@.@..@@@..@.@.@@.@@@@.@.@@@@.@.@@.@.@..@.@@.@.@
|
||||||
|
@@@@@..@@.@...@@@@@.@@@.@@@@@@@.@@@.@@@@@@@@@@@.@@.....@..@..@.@@@@@@@@@.@@@.@@.@@..@.@........@..@.@@@@@@@@.@@.@.@.@@.@@@@.@....@@.@.@@@@.@
|
||||||
|
@@@.@..@.@@.@@@@@..@@@@.@@..@@@@@@@@@@@.@@@@@@@..@@.@@.@@@@@@@@.@@@@@...@.@..@.@..@..@@@.@@.@@@.@@.@@.@....@@@@@@@@@.@@..@.@@@@...@.@@.@@@@.
|
||||||
|
.@.@@...@@.@@.@.@@@@.@@..@@..@..@@.@@@.@@@@.@.@@.@.@@@@@@@..@@@.@@@@@@@@.@@.@@@..@..@@@@@.@@@.@.@@@@.@...@@@@@@@@@@.@@.@@.@@@.@@@@.@.@@..@..
|
||||||
|
@..@.@..@@...@.@@@@..@@.@@@.@@@@@.@.@@@@..@@@@@.@@@@.@.@@.@@.@@@@.@@@..@@@@@..@..@@@@@@@.@...@@@@..@@@@@@@.@.@...@.....@@@@@..@.@.@@.@@@@@..
|
||||||
|
.@.@@@@...@@@.@@@@@.@@@@@@.@@@@@@..@@..@@@@.@@@@@@@@@@@@@.@@@@@@..@@@@@.@@@@@@@@@.@...@@@@@@@.@.@@.@.@@@..@@@@@@@..@..@@@@@@@@..@@@...@@@.@.
|
||||||
|
.@@@@..@@@@@@@@@@@@@@...@.......@.@.@@@@@@.@.@@@@@@@@@@@...@.@@@@@@.@.@@@@@.@.@@@@@.@.@@..@..@.@@@.@@..@@@@..@@@@@@.@@@@.@@@@..@@@.@..@..@@@
|
||||||
|
...@@@.@..@@@@@.@@@@@@@.@.@.@....@@@@.@@@.@@@.@@@@@.@.@@@.@@@@@@@@.@@@@..@@.@@...@@@@@@@@@@@@@@@@.@@@@.@@@..@@@@.@@.@..@@...@@@.@@@@.@..@..@
|
||||||
|
@..@.@@@@@@@..@@@@..@@@@..@.@@@@@@@@@@@.@@@@@@@@@@@@....@@.@@@@@@@@@@@@@@@@@.@@.@.@.@@.@.@.@@@@@@@@@@@@@@@...@@@@@.@@...@@@...@@..@@@@..@.@@
|
||||||
|
@.@....@@@@@@@@@@@.@@@.@@.@@@@.@..@@@@@@.@@..@@@@@@...@.....@.@@...@@..@@...@@@@@@@@@@.@@@@@..@...@.@@.@@@.@@@@...@@@@@..@@@@..@@@@@.@@@@...
|
||||||
|
@@..@@@@@@@@@@.@.@@@....@@@@@@.@@.@@@@@..@@@.@@..@.@.@@@@@@.@@@@@@.@@...@@@@@@@@@.@@@@@..@@@.@@@.@.@@@@@@@@@@.@..@.@@@@.@@@..@@@@.@@@..@..@@
|
||||||
|
@@@....@..@@@@@@@@@@.@...@@.@@@@@@@@@@@@@..@@..@@..@@@..@.@@.@@@@.@@.@@@@.@@.@.@@@.@..@@@@@@@@.@.@@@.@@@@@@@@.@@.@@@.@@@.@.@.@@@@..@@@.@@.@.
|
||||||
|
@@@@.@@@..@@@@@@@...@@@@@.@@@.@@@@@@@@@.@@.@.@@@.@@@.@.@.@@@@.@@@@@@.@@.@@....@@@@@@@@@.@@@.@@@.@@@..@@....@@@@.@.....@@@..@@@@@..@.@@.@@@@.
|
||||||
|
@@.@@@@.@.@@.@@.@@@@@@@@@@@.@.@@.@.@@.@@@@...@@.@.@@@@@@.@.@@@@@@@..@.@@.@@@@...@@..@@@@@@@@@.@@@.@@.@@.@.@..@.@@@..@@.@@@.@...@.@@.@@..@@@.
|
||||||
|
@@.@@@@@@@@@@@.@@@@.....@.@@@@.@@.@@@@@.@@@@...@@@.@.@@@@@@@@@..@@.@.@.....@@@@@@@@@@@@@@@@@..@.@@@.@@@@@.@@@.@.@@@@@.@.@.@@@@@@.@@@.@..@@.@
|
||||||
|
@.@.@@@@@.@.@@...@@@@@@..@@.@@@@@@.@@..@@@@...@...@.@.@@@@@@@@@@@@@@...@@@..@.@@.@@.@.@@.@@...@@@@@..@@@...@.@@.@@@...@@@@.@@.@.@@..@.@@@@@.
|
||||||
|
@@@.@@.@@@@..@@@@@@.@@....@.@.....@@.@.@@.@@.@@@@@...@..@@...@@.@@@@@.@...@@@@.@@.@..@@.@.....@@@@@@@@@.@.@@@...@.@.@.@.@@@...@@@@@@..@@@@@@
|
||||||
|
@.@.@@@@@@@@@@.@.@@@..@..@.@.@..@.@@@@.@@@@@@.@@@@@@...@.@.@@@.@.@@@.@.@@..@@.@@@.@.@.@@.@..@@.@..@@@@@..@@..@@.@@@..@..@@@...@@@@.@..@..@@.
|
||||||
|
.@@@@@@@..@@@.@@.@.@@@@.@.@@@@..@@..@@@..@.@@@.@@@@@@@.@@..@..@..@@@..@@@.@@@@.@@@.@@..@@@.@.@@@@.@@@@@...@.@@.@@.@@@@..@..@.@@...@.@@..@@..
|
||||||
148
2025/day-04/part-one.py
Normal file
148
2025/day-04/part-one.py
Normal file
@@ -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()
|
||||||
9
2025/day-04/pyproject.toml
Normal file
9
2025/day-04/pyproject.toml
Normal file
@@ -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",
|
||||||
|
]
|
||||||
20
2025/day-04/uv.lock
generated
Normal file
20
2025/day-04/uv.lock
generated
Normal file
@@ -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" }
|
||||||
Reference in New Issue
Block a user