initial commit

This commit is contained in:
m
2024-12-05 15:22:04 +08:00
commit 5dbf437175
106 changed files with 20207 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
temp

2
build/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

23
readme.md Normal file
View File

@@ -0,0 +1,23 @@
# advent of code
i decided to throw all of my advent of code into one giant monolithic repository
information for each languages i've done are in `utilities`, in the readme file
source is in `src` and resources are in `resources`
## how to run?
there is a very useful run.py in the root dir
run it like this:
```
python3 run.py pascal2023day1part1
```
and it will find the answer to day 1 part 1 2023 written in pascal
you can shorten day and part to just d and p
---
thanks and have fun.

1000
resources/2023/day1.txt Normal file

File diff suppressed because it is too large Load Diff

140
resources/2023/day10.txt Normal file
View File

@@ -0,0 +1,140 @@
F|--L7J.L7|7|-LF7-7--7F7--7F7J--F7J.7F|J7.F7|.-FJF|J.F7F--LFF.7.F7JFL-JFJ7F|.FL77-F7-J.F7-F7L-FF-F-L7F-|7.FL7-7F|7F7.F-F|-77FJ7FF-J777.|FFFL
FJJ7FJ.F.-7-|77|JFJJL|7|F7-FJ7JLL|||L-L7-FJJ|7.|J-.J..LJ.--F|7F-FJ7|LJJF7L7J.|-7.FL|.L--7-L|JFL-F|7L|7-|F7F|7.LJ.F7.|L7L-J|-|-LFF-LLJ|LL7|7J
F|.FL|.LJ-L.||FL-|-FJ|JJ7-7|.J.F7--F-|-|FJ-|-|7.|.7|F7.|-L-LJFL--77.F-|J|F-7F--JLJ7|..LLJ.LLJL7JLJ7-F-F7|FJL-77.FJJFL-|F|7F-F7F7JF-77||JLJLJ
||FJ|LF-7F|F|LJFFL-|F|7|JF-J7LJF7.|L-J.F|J7||FJ.LJL-|J.|.F-7F7J.F-|7F-J7L7-77L||L7F7FF7-|JLF-.7-F|-7LLJ7F-.LFJ77L|.|.|L|.L--|JFF7F7L|L|||.LF
L-L-|..J-J|7.|J-||LFF--7-J.|7|.FJ-L7.LFJ|LF7.||.|.F---FF77|F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L-JF-7|LJL-J|||||LJFJ7LL7J
|77.J7L-7|FJ|||L--JLJFJLJLJ||FF7LLJ|||||||||LJ||FJ||L-7|||L-7||LJ||L7||||F-7|||L7||||LJF-J|F7||FLJ||FJ|||F--J|L-7L---JJLJJF-7L|||||F-JJL-J|7
L7---LJ-J-F-J|L-----7|F---7|L-JL---JLJLJLJ|L-7||L7|L7FJ|||F7|LJF--JFJLJLJL7LJ|L7||||L-7|F7||LJL-7FJ|L7|LJL--7|F-JF-7F77F-7L7L-JLJLJL7.|L7J-|
.7JJ7||LLLL-7L7LF7F7LJL--7LJF7F-7F-------7|F7||L7||FJ|FJ|||||F7L--7L---7F-JF7L7||LJL7FJ||||L7F-7|L-JJLJF--7FJ||F-JFJ|L7|FJFJF7F7F-7FJF--77J|
FJ.FJ7L7.L|-L7L7|||L7F7F7L7FJ||7LJJF-7F-7|LJLJL7|||L7|L-J|||||L---JF---JL-7||FJLJF--JL7||||FJ|.|L7F---7L-7LJL||L-7L-JFJ|L-JFJ||||FJL-JF-J-F.
|.FLLL.FFFJ.|L7|||L7LJLJL7||JLJF---JJ|L7|L---7FJ||L7|L7F-J|LJL--7F7L-----7|||L--7L7F-7|LJ||L7L7|FJ|F-7L--JJF7||F7|F--JF|F7FJ.LJLJL7F--J7..LL
F.7F|L7L7|F7F7||||FJF-7F7LJ|F--JF---7|FJ|F7F-JL7||FJL7|L-7L7F---J||F---7FJ|||F7FJFJ|FJL7FJ|FJFJ||LLJFJF---7|||||LJL----J||L--7F7F-JL-7F7J7-|
L-L-7L--JFJLJLJLJLJFJ|LJL-7|L---JF--JLJJLJLJF7JLJ|L-7LJF7|FJ|F7F7|||F-7LJFJ|||||7L7|L7FJ|FJ|FJFJ|F--JFJF--J|||LJF7F-----JL---J||L7F7FJ||LF-J
LFF7FJ||-L-----7F7FJF-7F7FJ|F--7JL---------7||F--JF7|F-JLJ||||||LJ|LJFJ|FJFJ|||L-7|L7|L7LJFJ|||FJL---JLL---JLJF-J|L--------7F-JL7|||L-J|-J7|
-J|FLJF7LLJF---J||L7L7LJLJFJL-7L7F7F----7F7LJ|L7F7|||L7F-7L7LJ||F-JF7L7FJFJFLJL7FJL7|L7L-7L7L7||7|F---7F-----7L-7|F--------J|F7FJ||L7F7||FL-
LJL-J7.L.FFJF---JL-JFL----JF-7L7|||L---7LJL-7|FJ|LJ||L|L7L7L-7||L7FJ|FJ|FJF77F7|L7FJL7L7FJFJFJ|L7FJF-7||F---7|F-J|L------7F7||LJJLJFLJLJ-77L
|F|J.|.|7FJFJ-F---7FF---7F7L7L-J|||F---JF7F7LJL7L-7||FJFJ7L7FJLJLLJFJ|-||L||FJLJFJL7FJFJL7L7L7|FJL7|FJ|LJF--JLJF7L7F7F7F7LJLJL--7F7F--7J-77J
||7-|LFFLL-JF-JF-7L-JF-7LJ||L--7LJ|L----JLJL--7|F7|LJL7L7F-JL-----7L7L7|L-J|L-7FJF-JL7|F7|FJFJ||F7LJL7L-7|F---7||7LJLJLJL7F7F---J||L7FJJ--J.
FL|FLF|7FLF7L--JFJF--JJL-7|F7F7L-7L-----------JLJ||F--JFJL--7F-7F-JLL7||F--JF7||LL-7FJLJLJL7L7||||F--JF7LJ|F--J|L7F7JF7F7LJLJF7F7|L7|L7|-77.
7-LJ-JJF7||L---7L-JF-----JLJ|||F-JF-------7F7F--7LJL--7L7F--JL7|L---7|||L--7|LJL--7|L7F-7F7L-JLJ||L---JL--JL--7|FJ|L-JLJL---7||||L7LJFJ77L77
F7-L-7.|L7L---7L7F-JF7F7F7F7LJLJF7|F------J|||F-JF7F-7|FJL-7F7||F-7FJ||L7F7|L-7F7FJ|FJL7LJL---7FJ|F7F7F7F----7LJL7L7F-------J||||7|F-JF7|FJ|
F7||L--L7L--7L|FJL--JLJLJLJL-7F7|LJL-7F7-F7|LJL-7||L7LJL-7.|||||L7|L7||FJ|LJF-J||L7||F-JF----7||FJ|LJ|||L---7L---JFJL-7F7F7F7|LJL-JL-7|L77L|
|L|FF..LL--7L-JL7F7.F-----7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F7.F|FL7|-LJF7F7LJLJL--7L7L--7|||F7LJL7F------7F---JFJ||||LJ|7F7-F-|J|F7---7.L--JL-JL--7|L----------JFJL-JLJL--J|F-JLJLJLJ7|F--JLJ-L-JJ|LFLJ
|L7-F7FJL7F7|LJL-7F7F7F|FJF--JLJLJL---JL-7F7F7LJF7F7L7||LJF7F7JJFJ7L7--JJJF|J7L7FF-----J|F----7FF7F7FJF7F7F----7|L-------7FJL----77JL7F-7JJ.
L7L7||L7FJ||L-7F7LJLJL-JL7|F---7F------7J||||L--JLJL-JLJ7FJLJ|J.|-JJL7JF.FJ-.7JF-L-----7LJF7F7L-JLJLJFJLJLJF7F7|L7F7F----J|F-----JF7-L7JLLL|
LL7LJL-JL-J|F7LJL-------7|LJF7LLJF-----JFJ|LJF--7F7F7F7F7|F--J.F|7|FFJ|L7J|J7LLL7F-----JF-JLJ|F7F-7F7|F----JLJ|L7|||L-7F--JL------J|-F77L-.|
.LL7F-7F7F7LJL-----7JF7FJ|F-JL7F7L--7F7J|FJF-JF-J|||LJ||||L---7F7J7|JLF7J.L7|7-|L|F----7|.F7FJ|||-LJLJL------7|FJ|||F7LJF7F7F------J.FLL-|-|
|FFJ||||LJL7F---7F7L-JLJFJL--7|||F--J|L7||-|F-JF7|LJF-J||L7F--J|L7-JJ.F7--F77L-7JLJF---J|FJLJFJ||F-7F7F7JF7F7|LJFJ|LJ|F-J|||L7F7F---7J7.77.J
|-L7L7LJF--J|F--J|L----7|F7F7||||L-7-|FJ|L-JL-7|LJF-JF-J|FJL--7|FJ7|J-|L7F||7.LF---JF-7FJL7F7|FJ|L7LJLJL-JLJLJF7L-JF7||F-J|L7LJLJF--J--7LL|J
JLLL-JJ|L-7FJL---JF----JLJ|||||||F7L-JL-JF7F--J|F-JF7L-7||F---J|L7-J.FL7|FJ|J7JL--7FJFJ|F7LJLJL7|LL--7F--7F7F7||F7-||LJ|F7L7L7F-7L---7FF7-||
LFJJ.|F77FJ|F-----JF--7F-7LJLJLJLJL---7F7|LJF7J||F-J|LFJLJL-7F7|FJJL--FJLJFJLJFF7|LJ.L-J||F----J|F7F7LJF-J|LJLJLJL-JL-7LJL-J-||FJF---J7-7FL-
FJLF7F|L-JFJ|F-----JF7LJFJF-7F-7F7F--7|||L-7|L-JLJF7L-JF---7||LJL-77|FL-7FJF7|FJ|-F7F---J|L-----J|LJL--JF7|F----7F----JF-7F-7||L7L----7J|7FJ
L-JJF-JF--J|LJF7F7F-JL-7L7|FJ|7||LJF7||||F7LJF7F-7|L7F7L--7||L7F--JJFFFFJ|-L-LL7L7||L---7L-----7LL---7F-JLJL---7|L----7L7LJFJLJJL-7F-7|FFJ.7
FLJJL--JJF--7.||||L7F-7L-J|L7|FJ|F-JLJLJLJL7FJ|L7|L7LJ|F--JLJ||L--7F7JFJFJJ|LL-L7||L7F7|L-7F7F7L-----J|F--7F7F-JL-7F-7L-JF7L7FLF-7LJLLJJJ77F
|F--L.|F-L-7L-JLJ|FLJ|L---JFLJL-JL---7F7F7.LJJL-JL7L-7|L7F--7FJF--J||J|FJF--7J7FJ||FJ||F7.LJLJL---7F--J|F7LJLJLF7L|||L-7FJ|FJF7L7|F7L|F|LFJ|
|L77LFJL-LFJF7F-7|F--7F7FF----------7LJLJL-------7L--JL7LJF-JL7|-F7||FJL-JF-JLFL7||L7|||L7.F7F----J|LF7LJL7F---JL7LJF-7LJFLJFJL-JLJL-7F|-J.|
L-F7.J.|LLL7|||FJLJF7LJL-JF--7F7F--7|F-7F---7F---JJF7F7L--J-F7|L7|||||F7F7|.LF--J|L7||LJFJFJ|L-----JFJL---JL7F---JF7L7L-7F-7L-7F----7L77.LLJ
J|L||.-|.|.LJLJL--7|L-7F--JF-J|||F-JLJL|L--7LJF7F-7|||L-7F7|||L7LJ|||||LJLJF7L7F7L7|||F7L7L7|LF7F---JF---7F7||F7F7||FJF-J|FJF-JL---7L-JJ.L-|
FL-J||F-7.F------7|L7FJ|F--JF7|LJL----7L--7|F-J||FJ|LJF-J|L-JL7L-7||||L---7|L7LJL7|||LJL7L-JL-J|L----JFF7LJLJLJLJLJLJFJ-FJL7L7F----J|7L-7-7J
J|.L-LL-F7L---7F7LJFJ|FJ|F7FJLJF7F7F--JFF7LJL-7LJ|FJF7|F7L--7FJF7|||LJF7F-JL7L7FFJLJL--7L-----7|JF7F7F-JL------7F----J7FJF7|FJL7F---7-7|F7|J
F-JJ.||.LF7F--J||F7L7|L7||LJF--J||LJF7F7||F7F7|F-J|FJLJ||F7FJ|7|||LJF-JLJF7FJFJFJF7F---J-F----JL-JLJ|L-7F-----7||F---7FJFJ|||F-J|F--JJ7F|FJ.
JJ--L-F--J|L---J||L7|L7|LJF7L--7|L--JLJLJLJ||||L--J|F7FJ|||L7|FJ||F-JF-7FJ|L7L7L7|LJF-7F7L7F--7F---7||FJ|F---7|LJ|F--J|FJ-LJ|L--JL7F-7-F-7.|
F|J.L-L7F7L-----JL7LJFLJ.FJL-7FJL----------J|LJF7F7LJLJFJ|L7|||FJ||F-JFJL7|FJFJFJL7JL7|||LLJF7LJLF-JL7L-JL--7LJF7||F77|L7F7FJF--7FJ|FJFL7L77
---.FJJLJL7F-7F---JJF-7F7L7F7LJF-7F7F7F7F7F-JF-JLJ|F7F-J.L7|||||||||F-JF-J|L7|FJF-JF7|LJL-7FJL---JF7FJF-----JLFJLJLJL-JFJ|||FJF7||L|L7F7|FJ|
FL|--77LJJ||FJ|-F7F7L7LJ||LJL-7L7LJLJLJ||LJF7|FF77LJLJF7F7||||||FJLJL-7|F7|F||L7L-7|LJF7F7|L-7F---J|||L----7F7|F--7F7F7L-JLJL-J|LJFJFJ|LJL-7
|LL77||L|LLJL-JFJLJL-JF7|F7F--JFJF-----J|F-JLJFJL7-F7FJ||LJLJ||LJF-7F-JLJ||FJL-JF-JL-7|LJLJF7LJF7F-J|F77F-7LJLJL-7LJ|||F7F-----JF7|FJ7|F7F7|
|JF-L-J.LJFF---JF-----J|LJ|L---J-L------J|FF7.|F7|FJ||FJL---7LJF7||LJ-F7FJ|L---7|F7F7||F77FJ|F7||L-7LJL7L7|F7F7F-JF7LJ||||F-----JLJ|7FJ|LJLJ
F-7|L|FL.FFJF-7FJF--7F7L-7L-7|F7FF7F-7F-7L-JL7|||||FJ||F7|F7L7FJLJF--7||L7L7F-7|LJLJ||LJL7L7LJLJL7|L--7L-JLJLJ|L--JL-7|||LJF7F-----JFJFJJ7.J
J|LL.77..F|FJFJL7L-7LJL-7L-7|FJL-JLJ|LJFJF7F-J||LJ|L7|||L7||FJ|F77L-7LJL7L7|L7||F7F-JL7F-JFJF7F-7|F---JF-----7|F7F7F7||||F7|LJF----7L7|J-L7|
J7-JF||F7LLJJL--JF-JF7F7L--JLJF-------7|FJLJF7|L-7L7|||L7|||L7||L7F7|F--JF||FJ|||LJF--J|F7L7|||-|LJF7F7|F----JLJLJLJLJ||LJ|L77|F---JFJL77.--
LF.7-F---7|-|-F7FJF7|LJL7F-7F-JF7F----JLJF-7|||F7|FJLJL7||||-|||FJ|LJL7F7FJLJFJ|L7FL--7LJL7LJLJFJF7|LJLJL---7F7F7F7F7|LJF7L7L-JL7F7L|F-JJF|7
FFFJ||-|FJ.-F-JLJFJLJF7LLJ.||F-JLJF7F7-F7L7|||||LJL---7|||||FJLJ|L|F--J||L-7FJLL7L-7F-JF--JF--7L7|||FF7F7F--J|LJLJLJL7F7|L7L---7LJL-JL-7J-7J
|JL-|7JF|-F-L--7FJF--JL--7FJ|L----JLJL-JL-J||LJL7F-7F-J|||||L7F7L7|L7F7||F-J|F7FJF-JL-7L77FJF-J|LJLJFJLJLJF7FJF7F-7F-J|||FJF7F7L--7F-7FJJ.LJ
|.7-|LF7J.F.LF-J|7L-----7|L-JF------7F-----JL7F-J|FJL-7LJLJ|FJ|L-JL7LJLJ|L-7|||L7L-7F7L7L7|FJFF--7F7L-7F-7|||FJ||.LJF7||||FJLJL--7|L7|L7L-7|
F7LLFF|J.F||FL--JF-7F7F-J|F--JF----7||F---7F7|L--J||F7L7F-7LJFJF-7JL7F--JF-J||L7L7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-7-7JFJ7---77|-7.L-FJFF7J|
77LL-J.-JJ-F--L-J-LF-F--7-.--|--LJ-FL-JJL7.7-JJ.FLJ-7-JLLL--7-|-|LLL7.--J.JJ-LF7-LLJ-L|J-LJ.LL7.LFJ.L|L-J--LL|7-7LJ-J|-7-J.|JL|JJ.7-L|JLJL.L

View File

@@ -0,0 +1,9 @@
...........
.S-------7.
.|F-----7|.
.||.....||.
.||.....||.
.|L-7.F-J|.
.|..|.|..|.
.L--J.L--J.
...........

140
resources/2023/day11.txt Normal file
View File

@@ -0,0 +1,140 @@
.....#...............#......................................................................#.............................#..........#......
........................................#............................#......#...............................................................
..............................#..............#....................................#..............................................#..........
..............#........................................................................#....................................................
..#...........................................................................................#.............................................
..................#.....................................#.....#......................................#.........#.......#....................
...........#......................................#.....................#...........#................................................#......
.............................#............................................................#.....................................#...........
.....#..................#.................#.........................#......................................#................................
....................................#.................#........................#..........................................................#.
................#..............................#....................................................#.......................................
..............................................................#.........................#.......................#.....................#.....
............#...............#......................#.....................#..............................#...................................
......................................#...............................................................................#.....................
.........................................................#..................................................................................
..............................................#.............................................................................................
..#.................#.....................................................................#.....#..........#..............#......#..........
..............................................................................#.............................................................
..........................................#.........................#..............................................#........................
.....#........#.............#...........................#...........................................#.......................................
..................................#...............#.............#.................#..........................#.....................#........
.......................................................................#....................................................................
...............................................................................................................................#.........#..
#.......................................#....................................................#.........................#....................
........#...............#....................................#...........................................#..................................
...............................#............................................................................................................
.........................................................#..................................................................................
..#..........................................#........................................#.............#............................#..........
......................#............................#.................#........#.............................................................
.........#.......#...........................................................................#.....................#.........#.........#....
................................#............................................................................#..............................
.........................................................................................#..................................................
.#.........................................#.........#..........#.......................................................#...................
....................#.................#...............................................................#.....................................
............................................................................#...............................................................
........................#.........................................................................................#.................#.......
.............#.......................................................#......................................................#...............
.......#.................................#.....#..............................................................#.............................
#...............................#...............................................................#.....................#.....................
.....................................#...................#.......................#.....#.......................................#............
..........................#.................#......#...................................................................................#....
..............#.............................................................................................................................
...#..........................................................................#............................................#................
.............................................................................................#.....................#......................#.
.......................................#..........................................................................................#.........
.......................................................................................................#....................................
.....#.........#.................#.................#............#.........................#.................#...............................
............................#.....................................................#.........................................................
...........................................#................................................................................................
....................................#.......................#.........................#............................#.....#..................
............................................................................................................................................
.....................#..................#................................#......#.....................................................#.....
.......................................................#.........#...............................#.....#....................................
............#.................................................................................................................#.............
..............................................#..............#.......#.................................................#....................
................................................................................................................#...........................
.........#.............................................................................#............#.......................................
.............................#...........................................#.....#............................................................
.....#..........#.....#...........#.............#.....#.............................................................................#.......
...........................................#............................................................#.....#.............................
......................................#.........................#.........................#.....................................#...........
............................................................................................................................................
.......#.....#.....#........................................#.................................#.............................................
.........................................#................................................................#.....#......#....................
........................#.......#..................#.................................#.......................................#.......#......
..............................................#.............................................................................................
...............................................................................#............................................................
......................................................#..........#..........................................................................
...#......#.................#.............#.............................#..........................#...............................#........
.............................................................#........................#..........................#.........#................
......................................#....................................................#.............................................#..
............................................................................................................................................
...............#......#.......................#.....#.......................................................#...............................
.#......#.......................#.........................#.......#....................................#....................................
...............................................................................................#........................#......#.......#....
............#...............#............#....................#........#..........#.........................................................
...............................................................................................................#............................
..........................................................................................................#.................#...............
......................#........#.........................................................................................................#..
....................................................................................#.....#.....#....................#......................
.#.........#...............#........................................#...............................................................#.......
..................#......................................................#..........................#.......................................
.................................#.............#................................................................#.......#...................
........................#......................................................#..............#................................#............
.....#..........................................................#.....#.................#..................................................#
.....................................#......#.........#...............................................#.....................................
............................................................................................................................................
............................................................................................................................................
.................................#..........................................#................#...................#..............#...........
.......#....................#............#.............................................#...................................#................
..#................#........................................#.......#..............................#........................................
........................#...........................................................................................................#.......
...........#..........................................#.........................#......................#....................................
...........................................#................................................................................................
......#...............................................................................#.........#...........................................
............................#.....................#................#........................................#...........#...................
..................#.........................................#...............................................................................
........................#...............#................................#.......#..............................#............#..............
............#......................#.................#..................................................#..................................#
..#................................................................................................#........................................
.........................................................................................................................#..................
..................................................................#................................................#................#.......
.......#.....................................#..............................................................................................
.................#...............#......#.....................#.............................................................................
....................................................................................#..................................#....................
..............................................................................................#............#................................
....#......................#................................................................................................................
......................................................#.................................#..........................#.............#..........
..........#.................................................................................................................#...............
.................................#..........#..................................#............................................................
.......................................................................................................................................#....
.......................................#..................................................................#......#..........................
.............................#.........................................................#.......#............................................
.........#....................................#............#.................................................................#..............
...#...............................................................................#.................#......................................
..................................................................................................................................#.........
....................#.............#...................................................................................#....................#
....................................................#...........#...........#...............................................................
.........................................................................................................#..................................
..........#...............................#............................#....................................................................
.............................................................#....................#.............................#..............#............
.#...............#..........................................................................#..........................................#....
............................#...............................................................................................................
............#......................................#............#..................................................................#........
.......#...............................................................................................................#....................
..................................#.......#..........................#........#...............#..........#....................#.............
....................#....................................#............................#..........................#.......................#..
..............................................................#.............................................................................
..#............................#............................................................................#...............................
..............#.....................#...............................................................................................#.......
..........................#........................................#....................................#...........#.......................
..........................................#.................................#.................#.............................................
................................................#...........#..........#.....................................................#..............
.........#..................................................................................................................................
...................................................................................#............................#.......#...................
....#.............................#.............................#.......................................................................#...
.........................................#.........................................................#........................................
....................#...........................................................................................................#...........
..............#........................................#..................................#...................#......................#......
.........#.................#........................................#...........#........................................#..................

View File

@@ -0,0 +1,10 @@
...#......
.......#..
#.........
..........
......#...
.#........
.........#
..........
.......#..
#...#.....

1000
resources/2023/day12.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
???.### 1,1,3
.??..??...?##. 1,1,3
?#?#?#?#?#?#?#? 1,3,1,6
????.#...#... 4,1,1
????.######..#####. 1,6,5
?###???????? 3,2,1

1350
resources/2023/day13.txt Normal file

File diff suppressed because it is too large Load Diff

100
resources/2023/day14.txt Normal file
View File

@@ -0,0 +1,100 @@
#...#...O....OO.#O.O........#.OO.#.O..O.O.#.#..O#..O...#.#......#..O.....O.###O..OO.#.....O.O.......
O.#..#..O.O...O..#OO#...#.#.OO....O.#.....O.#OOO.#O.#O#O.......O......O.OO.#.#.........O..#.....#...
....O..O..O#...#O#......O...##O#.O.....#O..##..O...#O..O.O..#.O..O..#.....OO....O.O.O...O......#.O.O
##O....O....#.OOO...O.#....O#.O#OO....O....O#...O..O#O.#..O.OO...O..O..#.#O..OO.O...O..#.#OO#.......
.O.O#OO..#...#..........O#.O..##.O..OO.O...#........O##.OOOO..#.#....O..O#O.#O.##..OO..O...#..O##...
OO...O##.....#...O.#O.....#.OOO.#.##...##...##.O.....##....O..O..#..#..OO...#..........OO..#.O#...O.
.OO#..#.O.O##...O....O...O....#.O.O..#.OO........O..O..O..###..O...O#..#..#......OO.O..#O....O##.#..
#O.O..O#...O..O.O.O...#.....O..O......O....OO.OO..O#.O#..#.O......#..O...#.O.##.#....O.OO.#...O...O#
.#.O.....O...O...O...O.#.........OO.....#................O....O..#..........##.O#.OO..O###..#.......
#O...#O..O#.......O...#..O...OO..#...O........#....O#..OO...O.O..#.OOO.....O..O.#...O.OO#.OO#.OO.O#.
......#.O...O...O.O...#...#O.O#....#.O..###..O....#.#.O.OO#....O#.....O...#.O......##......#O..#OO..
#OO.##...#..O....#...#...OO...........OO.O.OOOO...#...#O..#...#O#.O.O......O....O..#.O..O...#O#.O.O.
#...O.OO...#.#.OO...O#O....OO....#O....O.O#..#....O...##..O..O.#..#..#...........O...OO#.#..O.....O#
..#..O.O#.....O....O#..#........OO#.#...#O.O....O#....O#...O..#....OO#.O.#........#O....O.O...##O.#O
....#O.....O#...O.......O.......OO..#.....#...O##.O.......#O#....O...O..O.O.......#.....#..#.O.O.O..
.....O.....O.O.O#O.O##.....OOO#...#O.O#O.....#.O#..........O#O.....O.OOO..##.#O....O.O.....#.O.O#O.#
O#O....O.#.......O.O.OO.#..#...#O#..O...O.......O.#........#O#....O....O.#...#.O.#O...O.#.........O.
........O.O...O.#O....#..O....#O.....OO#..O.O..####..#...O..O...OOO.#OO..#....#...OO..O.....#O..O..#
O#...##...#..#O#..#O#..O#....OO..O#O#.....OOOOOO#.#.O.O..O.OO.O........O...#.#......OO#...#..#.#...#
..OO.O..OO.OO....#........#O.#...#O....#...O.OO...O#..O......O.###....#O......#.....####...#..#.#OO.
..O.O..O#....#.O.#.#.#.O#..O.......OO.........##.O.....#OOO..O#..#OO#.....O...OO.O.O...#...OO#.O.#..
O...#........###..##..O#.#O.O..O.#OO.OO...#....#O.O#O..OO...##....O......OO..#...#.......#...#......
..O..#.O#...OO#O.O#....#.....O#..O..O#..O.O..O.#O.O.#O.#OO..#........#.#O..#O....O..#...#OO#...#.O.O
..#O..O.....#....O.O...O.#O.#.O#.O......#........OO...O....#.O........O#.OO#..........O.O..OOOOO#.#.
O..##.##...........O##.#...#.O.#.OO..O.O...OO#.#..#...O..O....#..#..#...O###......O#.#O#..O.#....O.#
#.O.O.O.###.##......#.OO...OO.O..OOO.O.OOO.....##..O#...O......O.#O..#...#...OO..O#......O....##.O.#
#...#.O.O....O..#...#........##O#O#O..##O.#......O...OO#O...OOOO#O..OO##..#......O.#O.#.O#.OO...O..#
#..#........#O.#O.#...O...O....#OO...O....#...O..#......#..O..O...##........O..#.O..#.#OO..OO.O##.O.
..#...#...OO.#.O#O.O.##..#..##..O#...O#....#..O....OO.OOO..O#.#....O.......OO.#.O#.....O.#O.O.#.....
.......O...O..O...#.O..OO...O.....O.O#..#OO#.O...O..O#O..O..#.OO.......O..O....OOOO..O.#.O#O#..O.##.
.####...O.....#...#......#.O...........O......O.#O.....O.#......#.#...O...#......#..O#.....O.O..O..#
O....O...#OO##.O.O...O....O..O......O.O..O..O..O#O..O.O#O.#O.#..OO.....#.O.#O#..##.#.O.O...OO....#..
....#.O..O..#...#....O............O.O.#O.#.O...O....O.#.OO....O..O##...O##......O....O...OO........#
.#O...O..O.O.#O.......O###OO.O.O.O.....##O..OO...#.O..#OO..#...#...#.O.O###.....#O#..##.#O.....O....
..#.###.#..##......#..#.#OO..O......O..#OOO.#O...#....OO.##O...O..#.#O....#OO....O.#.......#....O...
#OO...#......#..#........#.OO.##....#...OOOO..O#O..O.#..#O........#O.OO#..........OO..OO....O..#O.#.
..##.##.O....#.##O..#...###..O##.#.#......O#O..###..##......O...#.....##.#...........O.O.O....O.#...
...O.#..#......#.OO..#..O##...O..O...OO##...OO.O#....O.O.#.O.....O..#..O..#...O..#O.....O.O..O.O#.##
O......###OOO#.#.....OO...O.....O.##.....OO..........OO#O#.O.#.#O....O..#O.#..........##O...#O....O.
..#...#...OO.OO#.....OO...O.O.O.##.##O##..O.#.O#..O.O.....OOOO....#....O.O.#..##OO.O#..#O.O.#...O...
.#.OO.##....O..O...O..#.##.O#OO..#.....OO.........O.OOO.#..O....O....OOO.#.OO..O..#...O#OO.OO##.#.O.
.#.OO.O#.O.O.....#O..O.O..O......O.#O...O..O...##.O#..#.O.....O...O....OO.OOO..OO.O...OO..#.#..OOO#.
.#..O.#.O..#.OOO....#O#O#............##.#.O...O....O.OO..#.O....O#O#.O.#...#....#..OO.O.O#.#.....O.O
O....O.O#....O..#.......O..#O.##.#...O..O.......O#.#.....#..#..O......O..O.....#............##OO....
O#.O...O.##O..OO..O.O.O.#O.O..##..O#.#..#O..O#O...#...OO..#.O.O....OO..O..#..O.......O.O#....O..#.O#
#.O..##......#..O#O..........##O#.#O..O#.#..#.O..##O.O.#.OO....O#..........O..#.##..#..O.#...#O.OO..
.O..#....OO...O.......#...#...O.##...O..O.O.........OO#O.OO.O..O...O.##.....##.....##O..#......O....
#..O.O..OO....O.O#.#O#........O..OO#.OO#O.O..O..#......O#...##.......#..##..O.#..#.O.O...#....#.O...
#..O.#...OO#.OO#.O.OO.O##.#....OO....#........#.O.O....O.#..O#..#....#.O#..O#..O.....OO..OOOO.....O.
.O..OO#.O#OO..#O..O.#......O..O..O.#O.#..#.#.O..O.O..O.....##.OO..#O.#............O#...#......O.OO.#
O......##OO....O...O......#...O..O.#...OO#O..O.OOO..O.....O...#.##..OOO.##...O.O....O#O....##...#...
..OO..#.O.O..#O.O...O...#...O.O#.##O....##...###O..O...O.O##..........###...O...O..#...#.#.....O....
#..OO....O..#O..OO...OO.............O.O..OOO.O.#.....O#O....#O.....#.O..O....O..O....O..O....O.#....
OO.O##..O...#O........#O...#OOOO.O..O....O...O..O..O#.O.O..##.##..O.#O...O#...#..O...O...OO.......O.
#..O#..O...O.#......#OO.OO.O.#...O...O#...#...O..##O#....#......#.....#..#O...#.O.O..............O#.
##..OO#..........#.O..OOOOO..#...#....#.#..O#O...O....#.O.#O#OO.#......#...O........O...O#....#....O
.....O...O#....O..O..OO.O..#...O.#..#..#...O#..#O....O.#.....#O....O...##....#..#......###.O.....O#.
#...O#..O..O#..OO....#.#...#O#..#.....#..#..................OO....O......OO.........O###O#....OO.O..
O#...O.O.O..##.....##....#....#......#...O.#...O..##...O..O...##..#....#..O..O#...##..O.O..OOO..#...
..#.......#.O..O..#O....#...#.....OOO#...O#...O#.#.#O.....O#O.#.O.#.O......O.#..O.O..O#......O.O..O#
...O.#.#..O.#..###..#...#.....O..O.....OO#..O..#.O..#....OOO...........#.......#..OO..OO#.#O....#O..
.O.O...#....#.#O..#..OO#..#....OO....#O..O#.#..#..O.#..O.#O#..OO........#O.#...OO....OO......#.#O...
OO.O.O#..#.#.#.O.OOO...#....O..O##...O.OO#.#.....O.....#.....O....#.........O...O..........OOO.O.OOO
......O...O...###....##.O.O..OOO..O.O......O.#.......#..O..........O#..#..#O.#.##.....###.#O#O#O..#.
O..#..#O.OO.......#.OO...#OO..OO.O#O.....#.#.O..OOO.OO.##O.O#...#.O......#..#O#O...O#..........O.O#.
OO#...O..#..O.#..O........O.....O.....O........O..#....###..O..O..#...O...#.#.##.......O..#.O#O#O...
.......O..O...O...O.OO#.O.#..OO............O.O.O.#..OO#....##O.....O#.....O##O.....O.#...###O.....#.
.....O....OO..O..#O.....O#..O..O.#.#O#.#O#....O.#O..O#.O#.OO......#.O#..O.O...O...#...#..O....#...#O
#...#....#..O..#.O..#.##O..#O..#..OOO.#..##.....OO.O.....OOO.#..O.#.##O#..O.#..#.#.#....#O#...##....
.OO.O..###....#O....O..#.O.#.......#....O###..O.#......O#....#........O...#O..#..#.........O......##
O#......O#.....#.O....#..#.O.#O.......OO#...#..#.#O.#.O.##......#.#.#..O#O.#...O......O..OOO..OO.###
#O.#.O...O.....O....#OO##...OO..#...OO.#O.OOO.O..#O....O............#....#....#...........O.OOO#.OO.
.O.O.#OO#O.O.OO#..O..#....O.#..O...O....O.#OO#O...##.......O...O.....#.O...#...O.##O...OOO.O........
.O#..O.......#..##..OO#.....O.#.OO#...#O.O..O......O..OO.#...#.#............O#O.OO.......O#........#
.OO#..O##...........O.OO.....#.##....O#.#.#O..O...O..#..#..O.......#......#.#...........###O##......
...#...#.....O........OO..#.#...O.#.....#.OO.....#.O.#OO......#OO..#.....#..O##..O..#...O.O.......O#
O...O...#O..#O#O.......#..#O....#OO....#.#O.....O....O##.#...O.......#.....#........#O.O...O...O....
..#.....OO.#.OO....O#O....O#O...O.O...#O.##....##O...#..##O#.OO#O..OOO.#.#......O.OO.O..O.O.OO.#O.#.
.......O.....##...O#.#O.#....O.....O........#...#.OO...#...OO........#OO#...#..OO..O...#....O#.#OO.O
..#..O.OO....O...#.......OO.O.##...#...O...#.O#.OO#....O...O..O###.O.###O..#....##.O.##....O..##...#
.......OOO.....OO..#..O..#O.OOO#O.....O.O#.....O....###..O#..OO..O....###O.OO...#..#.O....#.O.O..#OO
.#...#.........#.###..#...#.#...#O.#..O#O#OOOO#.#.O.....O.#....#..O......#OO....O..O.O.#.O......O..O
O.O....O....O..O......O...#.....O##....OOO.....#.OO.#..O....O..O.O#.O#.OO......#....#......OO......O
..#O.#O.....O...#O...##.O#..O...#..##.O.O.O....#.....#.O#O.....#............O....#.#...#....###...#.
.O..O...OO.....#...........##...O#.O##O........OO..O.###O.#..#..#.O..O.......O....#O.#.........#...#
..##.O....O...O.O.O#O...#O..#..#.#.O...#O.O.O.....#....#...........O...O....O....OO#O.#.O....#..O..O
.#O#....O.....O#O..O##O#..O..O.O.....O........#.#......O#..O..OO.OO#.....OO........O......O#...O.#..
....#.....O..#......O...##.O.O.#..#.....O.O..#.O#.#O...##....O.......#O..O.....#..#.....#.....#.....
.OO....OOO.OO....O...#.......O......#O.#O..O.O#O..............O.#......#.#.......#....#.O....#.#O.#.
OO...OO.#.O#OO#........##.O.....#..#O.#....O..O..O.O#..........O..O.O....#..O.......O....O....O.OO.O
O.#O.......O#.#...#........O...O.O....O#OO....O.O.O...#.#.O#...#O#O.....##..O#O...#O....O....O#OOO.#
.OO#..#..O..........##.O.#OO#..O.O.#...#....O..O#.O..#.#.....O.O..#..OO..##O#...O.O.O#........O.....
.O............#.O...#...#....###.O#.#.#....O.....OO...#O.#.O..O##...#O.#O..OO#..#.O#.#.....O#.......
#..O#..#.OOO#O...O.O..O..#OOO....#...........O##...OOO##O....O.O...O..O#O.........O.OO.....O....O...
.#....#OO..##O..#O##O.#O....#......O.OO..........##.OO#O...#.....O.O.....O#..OO.#........O..O.O..O..
....O.##...#.O.........O.OO....#....##O..#O.......#..O.##O#..#O..#.....O.O#O....#...O..O.OO.........
..###.O.....##.....OO.O..OO.O..#...O.....#....O.O...............O.##.#.O#O#.#...O..#.OOOOO....#.#.#.
O...O....O.#.#.O#.O#..#......O#.....OO.##....OO.....O.......O....O.O.....#...O..OO#..OO..O....#OOO.#
#.#.#.O..#.O...#....#..O....O......O..#..O.OO#O......O.......O.O.........O...O.......OO.##.......#.#
O#..........O...#O.###....#O..O.#......O....#.O.O...O...O.....O#..#.O#..O.#.O..OOO#.O...#..O.#O.....

View File

@@ -0,0 +1,10 @@
O....#....
O.OO#....#
.....##...
OO.#O....O
.O.....O#.
O.#..O.#.#
..O..#O..O
.......O..
#....###..
#OO..#....

1
resources/2023/day15.txt Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
rn=1,cm-,qp=3,cm=2,qp-,pc=4,ot=9,ab=5,pc-,pc=6,ot=7

110
resources/2023/day16.txt Normal file
View File

@@ -0,0 +1,110 @@
\.........|......./...|........................................................|............|-...\...-/.......
.....................\.......\........./...|...............|...\................................-...|.......\.
.......................................-....-./............/.......-.............\..|.......|......//.........
...../..../.....\.........-.........-./..-.......\./..\.............-.....\..........|-..................|....
...........\..\...............-.............|.......-.\......\...\..........\.......-.....|..................\
................|.........|........|............--........./\....|-.....................................-.....
........./...........\................../...................\././........./...-...-.\.-.........-.............
......|.....|............-............./...|...................-...|........./............/......./...........
......./........../..|.....-...........\|.................................................\.........|..../....
........................|..................|.......|.................-..\...........-/.\.................\.|..
.......|...|./....................................-...\........\.......|............................|...|.....
\..-................................\.......\........../....|.....................|........\../.........../..\
....-|...............................\....|..............\.....................|.....\......\............../..
.....\......-.........-.\.|..........|...............-.................|..........-............../............
.........-...................-.............................................-.........../...................|.-
....................\..\........|-.\...............-............/....|..................../...................
.\.........-........................|..-.......|.......-...........-.-...................\/...\....|....\.....
.-........-./.....-.....\.......-..........\..-........\..-.....................................\..../...|....
....-.........................|..\.....................................\./...............-............/.......
..........|..\....-........./..............................|........................-.......|./|........\.....
..\.........|..|..-|........\...-................|/..\......../.......-|..................||.-./..............
.--..-.......-........./.................\....../.................-............................--.........-...
.......|.........../......./........../..\.........\...\../..\..././.......-..................................
.........-/...............|..\|.................\...........|............../............\.....................
..........-.........\.-................|-..................../......../...|/...\..-....|-........-.......-....
.--|.\|.......|.....-............................|.-....-...|...................|........../..................
.....-......./..../.|...................|\..-.........../...|.............................\/../........../....
......./........|.\......-../...........\........................./..........\.........-...\................|.
./.......................\........-......|...|............................/............\....-.....|..../...\..
....................-..............-..-.............../..\...../.\.........\................../.....\.....-...
...................../......-....-.......|....|......../..|-...............\..\../.-.....././..........|......
..\.....|...\............................./.../...../..../......../...........................................
./.../................................../.....-.........|.....|..........-...............................-....
...............|..\...-................................\.........................|....\...............-.-.....
/........|.......|.....-.......-..-..-.\.................................-.\...-.......\.............-..\.....
./......|../......|................................/.........||.-....................|..\.........-....|../...
|..................................................\......|...-............................../.......-........
....../...............-....-..................\....-../................................./.\.................-.
......-...........-...../.....-......|..........\.\...-......../......\................--..............-......
.............\/........|...../...........-.......\...|........................................................
...\\........\..........|...\............/........-..../....-.....................-......................../..
.......-......../......./..........-....|....-..\.........................\.............../..........-.....-..
.....|\/..../.........|.........../|.....\.......-........-............../..././.............|................
.........|....|....\..-....../............/.....\/....|.............\........................|.........-......
.\\..........................//......................\....\...........................-.|/....................
...................|...................-.|........................................../..........\..............
......\..|....../...........\.-.........-.......-..|../........../.............................../.......-...|
..........|................/|.....-.....\................||........./.............|.........../..-..|./.......
............../../|.......\...............-..../|..../-..|................................../......-....|..|..
............\...............\.........................\....-.............-..|/.....--...................-...-.
.....|\......\...........................-.................-.......\...............|............|........../..
.....\...-.............|............\........\...../.-...........|.-.................\.........|..............
......./......\..-............|..-...\......................\..........|....../..........|........./.......\.-
..-.....|........./|............./.....................|...|.\....-.......-..........|...\.\|-........\....|..
......................../............-...........|...................../............-.......\.........-.......
......../..............-./...................................--........................\....-.......-..//.....
........|.....-....................|...../..............-..........-......|..\................................
.......-..//.............../.....-......................./..|........./...........-..../..|.........-.........
.-...............-...........................\.......\...........-..................-.|...\..\.....\..\.....\.
.........-../............|......|.|.........................\.......-......\...\..............-../.../-\......
.-...........-..|.....\/........-.|...................../.|........-...........\..........\.....\/|..../...\.\
.-..........\.\-..\....-\/................./.\.......|.........................-............./....\........./.
.............\.........|............/...........\\................./..-..........................|//.......\..
..../-........-.........................-\...........|................./..........|.............|.\..|........
...-..|.....\..-..\.................\-.................|...../.-..........|........|/...-.-.\.................
.-.-............................|.....\..-..........|/|.........|....\............\.....\..-...........|/...|.
......................../...............|..-............................-.........|........../.-....../.......
.........|-...................|.....................-...........|.../..............................|....-...-.
..............|....................................................|.....|.......--.....\...\.............../.
..-...............|........|..................-............|.........../.....\................................
........................|.........|............-....-..\../..................\..|......\.........\../.../.....
.|............................./..............-....-.......--....-.../..........|.....\.........-/.....|-./...
....-..............|...-.....\.....\/.-........................................-.\.............|...../|/......
........./..-................/........./..............-............................................-....-.....
...........-........./...................../.........-........-................./.|...........................
............................................................-.............-..-......|..........-.\............
....\/........................-../.../.................................\............/..........|./-......-...\
....-............../..-.\.......|......-...|...|.........../......|../...........|..-.\.................../...
...-......../....-........................|...-............-.........................|/.....|.........|......-
...|........-.......-.......|...|\.......\............-...-...................................-|........-.....
....\/..-.....-.....-..--./-..-............../................|............\.............../.......|..........
.........-.\.......-......|........-.............|..../..............\-.....\..........-..../.................
.................-......\|.--..../../.-......-.......-........\....-...../....................../.............
...../..../....../.............-......\..........|..........\..\........-.-...................................
..............................|........./........-..................|.............-.../.................\..-..
.....|./......-........\...\.................|....-........|..............|...................................
\...|............................-..|.............../..............|.../......-......-.........../....../.....
..../.............................-..........\.....\-..................................-........../...........
..........................\....................-...-/.|....................../................................
\.......|.........-............\\...............-...-...................../...................................
..\...................................-................................................../.......\.|..........
...............................-................/........\....\.......|...................-.../.....|.........
...-..-............-.||..../././..........-\\............||...............-.\.........../...\........|...\...|
....\./.|./...................\..-.-./..-.....||............../............|.......\.|...../..................
......-.......\.\.........\......|..\...\.-|.\..............|...|......\......./...\........................-.
........./.-......../....|..............................|...|...\........//./.................................
.........................|...........\...........|.....................\........//..-.................\-/.....
.\....................\..-.-..-..........|/.\..........\././.....................|............\....|...|/.....
......./.................../...-.................\.........../.........\................|....................|
......-..\....|..................\............\........|......|....../........................................
.........\/..............|.............\.........-............-...........\.\..\./....../.....//..............
.........../...\.......-.../.-.............\../....\|./............/...-..\........|..|/.....\......\\........
..|............/..............................................-./...-.|..........-......../...................
...............-..|.......\.............\..../.....................|..........\...................\.....\./\..
.|..........\..\...|......................\...........-.......--........................-.....................
...................../................\.|..........-..|................-................................-.....
...../.........|-............|.\.|.../\.....|../........\../..................................................
................/........\../.....................\./..../...........-............\-......../../..\.|.........
..............|.........-......|/......././.....|..../.|...........-.....................|./.-.....\...|......
.......|..-.......\..........|................................................/..\.....-..........-...........

View File

@@ -0,0 +1,10 @@
.|...\....
|.-.\.....
.....|-...
........|.
..........
.........\
..../.\\..
.-.-/..|..
.|....-|.\
..//.|....

100
resources/2023/day2.txt Normal file
View File

@@ -0,0 +1,100 @@
Game 1: 1 green, 2 blue; 15 blue, 12 red, 2 green; 4 red, 6 blue; 10 blue, 8 red; 3 red, 12 blue; 1 green, 12 red, 8 blue
Game 2: 5 green, 2 red, 18 blue; 18 blue, 6 red, 9 green; 6 blue, 3 green; 6 green, 1 red, 9 blue; 19 blue, 2 green, 6 red
Game 3: 16 red, 10 green; 12 red, 6 blue, 9 green; 10 green, 5 blue; 10 green, 16 red; 5 red, 8 green, 8 blue
Game 4: 9 blue, 20 green; 1 red, 3 blue, 10 green; 7 blue, 18 green; 4 blue, 20 green; 8 blue, 1 green, 1 red; 1 green
Game 5: 3 green, 8 red; 1 blue, 10 red; 6 red, 4 green; 8 red, 1 blue, 3 green; 1 blue, 4 green, 3 red; 1 green, 1 blue, 4 red
Game 6: 7 green, 15 red, 11 blue; 2 red, 12 blue; 11 red, 11 green
Game 7: 14 green, 10 blue, 4 red; 3 red, 11 green, 14 blue; 1 red, 2 green, 11 blue; 9 green, 1 red; 6 red, 6 blue, 9 green
Game 8: 1 red, 6 green, 3 blue; 4 green; 4 red, 3 green, 1 blue; 2 red, 10 green, 3 blue; 2 green, 6 red, 3 blue
Game 9: 2 green, 8 red, 3 blue; 2 green, 4 blue, 2 red; 2 green, 5 blue, 2 red
Game 10: 9 green, 1 blue; 2 blue, 12 green, 3 red; 2 red, 3 blue, 1 green; 3 blue, 8 green; 4 blue, 4 red, 1 green; 5 green, 4 blue
Game 11: 5 red, 2 blue, 2 green; 3 blue, 2 green, 8 red; 6 red, 1 green
Game 12: 8 blue, 7 green; 2 green, 2 red, 7 blue; 4 green, 1 red, 20 blue; 5 green, 13 blue, 2 red
Game 13: 1 blue, 11 green, 13 red; 6 blue, 13 red, 19 green; 5 blue, 6 green, 6 red
Game 14: 12 blue, 1 red, 15 green; 16 green; 1 red, 18 blue, 15 green; 14 blue; 12 blue, 1 red, 8 green; 4 blue, 16 green
Game 15: 6 blue, 3 green; 1 red, 1 blue, 2 green; 3 green, 4 blue, 7 red
Game 16: 17 red, 14 green, 6 blue; 5 blue, 2 red; 1 blue, 11 red, 2 green; 13 green, 12 red
Game 17: 14 green, 4 red; 1 green, 5 blue, 15 red; 5 green, 14 red, 5 blue
Game 18: 8 blue, 2 green, 1 red; 12 blue, 1 green; 1 green, 1 red, 5 blue; 1 green, 1 red, 9 blue
Game 19: 1 red, 2 blue; 2 green, 5 red; 1 blue, 2 green, 11 red; 10 red; 4 green, 11 red
Game 20: 5 red, 11 green, 5 blue; 2 red, 5 blue, 7 green; 12 blue, 5 green, 10 red; 4 blue, 15 red, 10 green; 11 green, 12 blue, 7 red; 15 red, 12 blue, 5 green
Game 21: 5 blue, 6 green, 1 red; 18 blue, 13 green; 7 blue, 3 red; 9 blue, 2 red, 14 green
Game 22: 4 blue, 2 green, 19 red; 11 green, 5 blue, 17 red; 12 red, 4 blue, 13 green; 2 blue, 11 green; 1 blue, 19 red, 10 green; 8 blue, 2 green
Game 23: 12 green, 6 red; 1 blue, 1 red, 11 green; 1 blue, 3 red, 8 green; 4 green, 8 red
Game 24: 8 blue, 1 green, 6 red; 6 blue, 9 red; 8 red, 1 green, 1 blue
Game 25: 2 red, 4 blue, 1 green; 1 blue, 4 red, 2 green; 1 green, 5 blue, 1 red; 3 red, 2 blue
Game 26: 2 green, 10 blue, 5 red; 14 blue, 6 green, 12 red; 7 green, 2 red, 1 blue; 3 blue, 5 green, 3 red; 7 blue, 1 red, 3 green; 5 red, 2 green, 6 blue
Game 27: 8 blue, 2 red; 2 green, 8 blue, 6 red; 4 green, 2 red; 2 blue, 4 green, 7 red
Game 28: 8 green; 1 red, 9 blue, 10 green; 8 green, 9 blue, 2 red
Game 29: 5 red, 3 green, 2 blue; 12 red, 6 blue, 1 green; 6 red, 12 blue; 2 green, 4 blue, 5 red
Game 30: 9 red, 1 blue, 2 green; 13 green, 12 blue, 11 red; 11 red, 5 green, 9 blue; 4 blue, 12 green, 3 red; 10 red, 8 green; 2 red, 3 blue, 12 green
Game 31: 11 green, 5 red; 1 green, 4 red; 6 green, 9 red, 2 blue
Game 32: 6 blue, 3 red; 2 red, 11 blue, 4 green; 1 green, 4 red, 12 blue; 3 blue, 2 red
Game 33: 1 green, 7 red; 15 red, 15 green, 1 blue; 15 green, 3 red; 1 blue, 13 green, 6 red; 1 blue, 13 green, 20 red
Game 34: 3 red, 5 green, 1 blue; 13 green, 5 blue, 2 red; 3 red, 3 blue, 8 green; 3 blue, 1 red, 1 green; 4 blue, 3 red; 9 green, 3 red
Game 35: 6 blue, 8 green; 6 red, 9 blue, 12 green; 4 green, 3 blue; 5 red, 3 blue
Game 36: 17 green, 1 red, 1 blue; 1 red, 7 blue, 13 green; 6 blue, 5 green; 9 blue, 6 red, 5 green
Game 37: 2 green, 16 blue, 1 red; 3 red, 5 blue, 4 green; 3 green, 5 red, 2 blue
Game 38: 10 red, 3 blue, 1 green; 2 blue, 4 red; 7 red, 1 blue; 8 blue, 5 red, 11 green; 12 green, 4 blue, 8 red
Game 39: 3 blue, 3 green, 1 red; 5 green, 9 blue; 1 green, 6 blue; 5 blue, 7 green, 1 red; 9 blue, 1 green
Game 40: 1 blue, 2 red, 2 green; 2 green, 14 blue; 2 red, 6 blue; 13 blue; 2 green, 10 blue
Game 41: 1 red, 1 blue, 1 green; 11 green, 1 red; 4 green; 5 green; 1 blue, 1 red, 10 green
Game 42: 4 blue, 3 red, 2 green; 6 red, 1 blue, 6 green; 11 red, 7 blue, 3 green; 6 blue, 7 red, 1 green; 11 red, 1 green, 6 blue; 2 blue, 4 green, 10 red
Game 43: 3 red, 5 blue; 2 green, 4 red, 3 blue; 7 red, 10 blue, 13 green
Game 44: 13 green, 5 blue, 3 red; 1 green, 5 blue, 8 red; 11 green, 4 blue, 9 red; 5 blue, 7 green, 9 red
Game 45: 12 red, 9 blue, 5 green; 9 green, 3 red; 3 green, 11 blue, 15 red
Game 46: 5 blue, 2 green, 1 red; 1 blue, 3 red, 3 green; 2 green, 7 blue
Game 47: 8 red, 8 green, 5 blue; 12 blue, 8 green, 7 red; 5 red, 1 blue, 2 green; 1 red, 4 green, 6 blue; 1 red, 3 blue; 5 green, 1 red, 3 blue
Game 48: 3 blue, 2 red, 5 green; 4 green, 5 blue; 3 blue, 13 green, 5 red
Game 49: 4 red, 9 blue, 1 green; 12 red, 8 blue; 5 red, 2 blue, 1 green; 11 red, 2 green, 9 blue; 8 red, 9 blue, 3 green
Game 50: 3 blue, 2 red; 3 blue, 7 green; 4 red, 2 blue, 8 green; 7 green, 2 blue, 4 red; 3 red, 3 green; 6 green, 4 red, 2 blue
Game 51: 9 blue, 4 red, 2 green; 5 red, 3 green, 3 blue; 5 green, 10 blue, 5 red; 8 red, 11 blue, 5 green; 1 red, 3 blue, 7 green
Game 52: 1 blue, 9 red, 6 green; 8 red, 1 blue, 4 green; 13 green, 3 blue, 6 red; 3 green, 9 red; 3 blue, 12 green, 7 red
Game 53: 1 blue, 9 green; 1 red, 2 green; 7 green, 1 red
Game 54: 3 green, 3 blue, 9 red; 6 blue, 11 green, 1 red; 6 green, 1 red, 4 blue; 4 blue, 2 red, 13 green; 3 green, 1 red; 6 blue, 3 green, 8 red
Game 55: 1 blue, 6 green; 4 red, 5 green; 8 red, 12 green; 5 red, 1 blue, 7 green; 1 blue, 11 red, 3 green
Game 56: 1 green, 11 red, 1 blue; 2 green, 8 blue, 3 red; 5 blue, 6 red, 1 green
Game 57: 5 green, 3 red, 2 blue; 10 green, 12 blue, 16 red; 7 blue, 13 red, 11 green
Game 58: 5 green, 16 blue, 5 red; 9 blue, 2 green, 5 red; 5 blue, 3 red, 9 green
Game 59: 2 blue, 2 red; 7 blue, 3 green, 4 red; 2 green, 1 blue
Game 60: 12 red, 5 green, 1 blue; 2 blue, 12 red, 4 green; 16 red, 4 green, 2 blue
Game 61: 3 green, 1 blue, 6 red; 4 green, 1 blue, 8 red; 4 red, 1 blue, 1 green; 4 green, 13 red
Game 62: 2 red, 4 blue; 2 blue, 13 green, 8 red; 4 red, 9 green, 4 blue; 8 green, 3 red, 7 blue; 3 blue, 6 red, 3 green
Game 63: 1 green, 3 blue; 6 blue, 4 red, 3 green; 3 blue, 1 green, 1 red; 2 green, 2 blue, 3 red; 1 red, 2 blue; 5 red, 6 blue
Game 64: 7 red, 10 blue, 4 green; 1 green, 18 red, 2 blue; 7 blue, 2 green; 10 red, 1 green, 7 blue; 3 green, 5 blue, 11 red
Game 65: 11 red, 2 blue; 1 green, 2 blue, 1 red; 3 blue, 2 green, 3 red; 3 blue, 3 red, 7 green
Game 66: 3 red, 7 blue, 11 green; 10 blue, 4 green, 9 red; 11 blue, 11 red, 12 green; 8 red, 7 blue, 10 green; 5 red, 14 green, 3 blue
Game 67: 5 green, 1 red; 7 green, 4 blue; 3 red, 1 green, 3 blue
Game 68: 9 blue, 11 green, 10 red; 12 blue, 3 red, 3 green; 8 red, 7 green, 9 blue
Game 69: 1 green, 7 blue, 1 red; 1 red, 9 blue; 1 green, 2 red
Game 70: 9 green, 2 blue, 1 red; 1 red, 2 blue, 16 green; 13 green, 4 blue, 13 red; 8 red, 7 green, 6 blue; 12 green, 3 blue, 3 red
Game 71: 2 green, 4 red, 6 blue; 11 green, 6 blue, 2 red; 3 green, 1 blue, 5 red; 7 blue, 6 green
Game 72: 4 blue, 1 green; 4 blue; 1 green, 3 blue; 4 blue; 1 red, 4 blue; 3 blue
Game 73: 4 red, 1 green, 7 blue; 15 green, 4 blue, 17 red; 19 green, 3 blue, 11 red; 13 green, 5 blue, 1 red; 10 blue, 13 green, 17 red
Game 74: 9 green, 2 blue, 18 red; 5 red, 8 green; 3 green, 4 blue, 3 red; 5 green, 3 blue
Game 75: 1 red, 10 blue, 1 green; 2 red, 19 blue; 4 red, 10 blue; 3 red, 7 blue, 1 green; 2 red, 3 blue
Game 76: 4 green, 9 red, 7 blue; 8 green, 7 blue; 12 green, 9 red
Game 77: 1 red, 6 blue, 2 green; 8 red, 5 green, 4 blue; 4 blue, 2 red, 3 green
Game 78: 9 blue, 1 red, 8 green; 2 green, 9 blue; 2 green, 9 blue
Game 79: 4 blue, 4 green, 1 red; 4 blue, 4 red, 4 green; 4 green, 1 blue, 6 red; 6 green; 6 red
Game 80: 13 red, 8 blue; 2 green, 14 red, 13 blue; 7 red, 9 blue; 11 red, 18 blue; 2 blue, 3 red, 1 green
Game 81: 2 green, 9 red, 12 blue; 5 green, 5 red, 13 blue; 5 blue, 5 red; 2 red, 8 blue
Game 82: 6 red, 15 green; 1 blue, 15 red, 13 green; 6 green, 1 blue, 1 red; 5 red, 6 green, 1 blue
Game 83: 1 green; 1 blue, 1 green, 10 red; 7 red, 1 blue; 1 green, 11 red; 2 blue, 1 green, 3 red
Game 84: 17 green, 8 red; 1 blue, 14 green, 2 red; 6 red, 1 blue, 6 green; 4 red, 10 green, 1 blue; 2 red, 2 blue, 1 green; 4 blue, 5 green, 3 red
Game 85: 5 blue, 3 red; 1 blue, 1 green; 6 green, 1 blue, 1 red; 4 green, 2 blue, 7 red
Game 86: 7 red, 3 blue, 4 green; 1 blue, 13 red; 3 red, 3 blue, 6 green; 1 blue, 1 green, 17 red; 8 blue, 13 red, 4 green; 6 blue, 4 green, 17 red
Game 87: 10 red, 3 green, 4 blue; 12 green, 10 red, 3 blue; 2 green, 16 red; 16 red, 3 blue, 14 green; 14 green, 11 red, 1 blue; 9 red, 4 blue, 6 green
Game 88: 7 green, 4 red, 19 blue; 1 green, 5 red, 18 blue; 19 blue, 3 green, 6 red; 9 green, 14 blue, 5 red; 3 green, 5 red
Game 89: 4 red, 2 blue, 10 green; 6 blue, 5 red; 3 green, 4 blue, 1 red; 12 green, 2 red, 2 blue; 3 blue, 3 green, 3 red
Game 90: 1 green, 19 red, 1 blue; 7 blue, 4 green, 10 red; 6 blue, 3 green, 13 red
Game 91: 1 green, 9 blue; 7 green, 4 red, 3 blue; 6 green, 2 red, 8 blue; 1 red, 1 blue; 3 red, 2 green
Game 92: 18 red, 2 green, 2 blue; 6 blue, 4 red, 6 green; 3 blue, 10 red; 8 blue, 2 green, 7 red
Game 93: 13 blue, 3 green, 15 red; 14 red, 2 green, 7 blue; 1 blue, 4 green, 13 red; 19 red, 5 green
Game 94: 6 blue; 5 green, 8 blue; 1 red, 9 blue; 1 red, 8 blue; 5 green, 6 blue; 1 red
Game 95: 9 blue, 14 green; 2 green, 1 red, 1 blue; 1 red, 3 green, 2 blue; 6 green, 1 red; 1 red, 8 blue, 14 green; 1 green, 5 blue
Game 96: 7 blue, 17 green; 19 green, 3 red, 2 blue; 6 green, 2 red, 2 blue; 3 blue, 16 green; 3 red, 20 green; 4 green, 2 blue
Game 97: 1 green, 1 red, 1 blue; 4 red, 2 blue; 7 red; 6 red; 7 red
Game 98: 2 red, 15 green; 10 green, 1 red; 1 red, 11 blue, 11 green; 13 blue, 8 green, 2 red; 1 red, 12 green, 7 blue
Game 99: 14 red, 2 blue, 1 green; 3 green, 13 red, 9 blue; 9 red, 9 blue, 2 green; 13 red, 7 green, 5 blue; 5 blue, 3 green, 11 red
Game 100: 1 blue, 1 red, 1 green; 8 blue, 1 green; 1 green, 7 blue, 1 red; 1 green, 4 blue, 1 red; 1 green, 3 blue

140
resources/2023/day3.txt Normal file
View File

@@ -0,0 +1,140 @@
........936..672.........846.922........359...332......582..856........................579..93......674..740.....243.156....................
...........%.........4=...*...*........*.......*......#....................806..481.........................*.......*.........900......$564.
.............520........624.965....143..405.....960.............273...651...*....*.........554....139@.....38...*.........58..*...392.......
................$....................*.........................*.....&......634.3..../.................-......310....*313.*.........*.......
...196....544......541................775.216...+557..225/..463.......................517..........960.228........452.....593.......772.....
.....*....*...654.*........638............*...........................163....................386#......................20......169..........
.....566..20...$...132........*969......747........*971..342............=.245*.......................277.522............*..............+....
.............+..............................205.716...........................855.............324......................871..752.........291.
.........47..390.......128...%....528........%..........91*192.......=.....................=.#.............%..852*156......+................
.....975..*.......=....*...322.......#............&63.............946...................462....939..520...268............#.....*....380.....
.........55..=.....871..68.............................................491.......................*.....*............674.770.333.415...*.275.
..............633...........@.....642.5........+.......739........632.....*.......992.74.615...858...998.............*..............761.*...
....446......................180./..../........83...&.....*924....&........379...*......................................................118.
...........488*240.......150......................958..........$.....&...........964...351...........+..633.........123....../603...........
...................987....../........546-...674...............466.....602.............@...........956..#............./......................
......503=....465.................91.........*..........................................583..............128..124..........$.....217........
..............*...32$..53....&594.........648...827....*..994.......971...................*..........304...%....*.......387..80.............
............756.......#..........................*..888...$............@....339.......+..868........*........851..............*.........128.
...905-.........312..................729...356*.697.........736.....+.......+.......748.......797....41....................272..753.........
.................*....&604............*.............%915.......*.529..889...................*.........................992.........*.....718.
...........272....487..............+...961.892..............632........*.................502.118....141................@......546.669.......
787..........*....................85............/..330...........-...374.............................*.........446...%.........*............
....-...../...120....919&.....................339....*....*663...403........167...533.170.............698..587...*....279.......776.+.......
.575.....34.*.................668...19..759.......804..730...../.............*...........*.....789...........*....803......666.......25.....
............375...773*.............*.........................$.876...287......201........484......*.........196.............................
565...866.............23..477...455....................794.996.........*.....................887.959...146...........496....790.............
..............648...........+........325.738....156.....*.........534..941.....%536..31..../.%...........*............*.....*.......511.....
..............*.................166.....*......*.....647..........*......................262...........887..210.3..860.....161....4....*420.
......141.606...........193.111..*..........252......................935*689..................500...........*...*.................*.........
..635....*........=........*.....959.....................@834.................-.....542..547....-..........770.8...........439..............
.................896.........93......................244..........@......247..735..*.................................497.............%......
...............................%........................*..........200....+.......342.613.245.@............$.........#....*.......176...21..
......51......702.37.......798....325.....&974.....834.860.....+.........................*.....533..866....864.............269..............
..141..*......................-...&............875*.............207...882*.........................*............309.739........%......../...
.......394....144.....................................$...................835.3..........290.......489...........&.....*177.833....866$.153.
.689.................719.314/..$......673.....5*557...443......+..#649.............575....*..634*...........................................
....&...........794...*........614...*......................350.............411......*.104.......141........369...934...........997.........
.......519......*...787..............739.....628...................................784.......$..........989*........*...987.......*....#....
.........*...309.........209.............957*........50.....@995...765.......269.@........380..624.................643.....*....836...356...
......886............234.+....................51*935..*...........*.....188.......73..............*696...14.....#...........................
............203..948...&...............................957......804.736*......388....689.219*660........*.....218....................$..40..
..............*.....*.....475.....930..........%................................*......*..............477.624................848...687......
....57*.50.229....636....*.................804.164....590.........-....547..80..310....675.......=.@...........................*............
........................398......&........*..............*.....748...........*................226..200................160......853..........
......292........................889.......867.....365...............192+..530.........................@910....=..222*.............894......
..427....#.../...959........................................322.....................735*304....742..........195..........$..............22..
...........465..-.........52.$......168.......418.......+.........................................$..............&......563...649*26........
....................464..../.969....*......-..*........150......724.....83..301...............527...............858.506.....................
...935.........910....+...........116....427...347.............-........*.....=.......891.......*....847...750........@................531..
....*.........$.........676...............................510............11.......647.*.................#.....%.683.............193...+.....
....761.169...............=...524........&......152..........*...975.994.........*....122..........858*...........%.......776...........*...
...........-..180/.850..............$.....524....-...........940.=......*......199........963..............#........836...*.....34...543.448
482...947...................94&....541..............265..............477..890..............*....988.....343..........&...599....+...........
.......*...532..81..73..417............992/...99&...#........................*.33@.149..305.........678.....31.........@.................417
....304.....@.....*...#../....452.842.................519.....307.949.....268................=.........*....*...........259.................
..................361............*.......346............*.+......*...........................288.......492..985.............727.683.........
....530....438..........950..........*......*........787..316...............762.724.257..889.....................844.......*......=....@125.
..............*...446...*......879..827......148......................*730.......@..........*...832...............*.......647.......48......
....500.......994........41.......*.....#805...........*...........614...............*....940................291&.129.8............=........
....*...#..........698..........581.................940.462.....@......443...82.784.593......../.#375..%148............*..#.................
.....39.562...784............................................805...$......@...*..*..........844.....................776....363...667........
................%...265.......337.....438...295.....................499......341.74..................271.405.......................%.155....
.........97..........*......@....*252.*......*....+.........270.229.................394...879*247.....*...*.....146.....................*...
........%.............226..258........996.944......793........*.../...................+..............321.578.....$..........838.....529.831.
.................%109.........................................615....822.....................501.............616....293.....&........-......
.......%....482...........................%717.236.......562...........*...........915...580....*............*.....+..........230...........
.....303.......*128..86&......762.928.............$........*......861*.311........*....../....517..........471.544.....996.......*38...628..
...........563............89.*......*.583...%.148.......$.987...................35..................996...........=....*...............*....
......776.....+...........*......967...@..168...*.....772.........838*.....480..............................-........976..............530...
................649*32...84.#...................315...................37............398.656...631..........340.985*..........522............
............................922........................./.173....894................*.........$....................177.......#..............
......................................................423....*....*.....816.........13.................=..............................251...
..154...................878*......................568......723..329....&......928.................-71.123.378..100...................*......
........*21..250............448.734.718.....&....*......................................599...............%....*.....700+.....*803..401.....
.779.550........*.817............./..*....118....980..589.....235......=....539...........*...281*236..........591.........927..........*...
...-.................*...............854.............*.................911.=............939........................616..*............770.50.
.............82......399.......452..................184........643..........................*871..................*....370..................
.185.405.....*...634............*......189.838.................*...............@623......252...........315.86.....568...........157.104.....
...&......586.......*........957..........*.......841.........509.600........................896..565.....*...............+............*....
..................633.628...........811..........*.....677.........-..580..751...183.........................540.81.......656..665..634.....
......112.............*.....=........./.322...430.........*..........+.....*...............683............$.....*...........................
830&...*..426........649..910...........*................717..359........831........=..157..%.............143......758................579...
.....373....*..................215.......666....................*.#...........459..547...+.........773.........980*.........404...126.......
205......636....................*...420.......440..........225.11.516...568....*......................*....474........620...*.....*.........
..............250......685...209.....+...........*257.................../...407.......295..498....122.............970...@.392.412...........
783..83+...........706....=.................330*............833.................*250....%..=..........%...........*............#....898.....
...........$....................................398..35........*......646....759.....#.............527..........160.....254.................
500........777...........112..428...663....957#..............524.....*..../........249..530*672............567......*......*759.....284*....
....861....................*.*......*............*...277*832.....644.130..216.446............................*...683.955................950.
....*........826..........68.535..192.........306..................#..................762%...%....#631..500.406..........763...137..........
..65............-...499=..................546.....&.........$........../..........177........988.......@.............336...*..*.............
.....362..................@...$..........-....610..65......64.........830..........-...........................452......+.604.542...........
........*902.633*........873..63.....781...31...*.................258.....12...681..........18*........&...&............................848.
..803............752.........................-.....672...................*.............................470..86.59.......%...................
.......@..547..........$...184.......320..........+..........471......834...=...551..108.............................176.................82.
..950.562............261...$.....754..+..............134.654*...............778..&......%..713.837.......................329........186.....
............112..72...............*..........917......*.................415............................946....=....614.....*................
..............*.$......850.....766.....308.....*....666................*......812.....293................*.624.......%..296.....612...333...
..996......154...........................*......283.....*.555.%........................-.......552.714.563.......227..............-.........
....*.682.................=.......281.217..............84.*....908.....@...=....522..............$.*.......630......*79..............556....
..635...*............516...402............................333........114..496..*.......324..........522.....................................
.........511....779...*............@............350.853.........................791...................................$.....821.....+.......
.................*.....486........984......332.....*..............893..730*480...................756...................776...........155....
......161......57..590....................@....398..................*....................477.....*......602....506............996...........
.151.....*..=.......*......955.......916........#.....=..269.........423..........289......*..379...*..@.....................*..............
...-....123..927.600...........-........*395........226./....676*755...........30..........58.....582.........671.118..43.367...943......478
.....................725........74...............................................+...........................-......*..*................&...
........378......563*.....*999............*...................497.349...26.....$............362.........&........723....20....717...317.....
...*....................22.........../.575.552..........291......*..........600......152.../......./...169......................-.@....*977.
886.250..........$.............383.603.............36*.../....%......................*.............253........215..........139....583.......
................225............................................721...814..............829..................*.......613*544.*...=........901.
..........741.......595.........785.............%677..50................=.................252......710....91...............912.180..........
...........*...................*....808...956..........+.....812...............*381......*.....676.../..........599....................+....
............134.184......759..81...*.........*.782........41*......=....125.216........679...../..........@........*.................567....
.......165.........*......@................66...*.....*.........379.....................................&..626...241........................
.........*.........232.........387.86...........635.47.806.857.........$537...............240........617..............806..941..........531.
.......687...654.......735......*...$......................%.....357..............*884.......*571..........273.551......*.....*....576..*...
............*................648...................716.304..........*...690....663.................*38...........*....365......911....@..424
....67*156...250..828...................&222.......#...*......16....300.+..................-....-.9....813...982..443.......................
.....................*......136..757..................65..314...*........................615.291.......&....*................972............
................721..592...@.............................../...808.............665...176.............................200.....*..............
..198..459+............................218........-772..............169...39..*........*........939..742......#....=......532...#..264......
.....*...............$..........713...*............................*.....*...831....689...589*.......*.......91....75.........641...#.......
..896..167*........372...138...........462...*227..$.....801......512.........................775.673.......................................
...............47........*.......135...............725.....*...............743..........489*.............735..622.815.551...........519.....
.......=........*......636.987...*...................................827........496*........48.121................*.....*........#.....*311.
....525.......819.580.........#.369......119...............77.........*...............10*........*.%.....975.....961....888......304........
........................96*..........................816............857......=...........376...859.522..=...................................
629...419..259...#360.......44%.........190..=969...........=...539.....-913.429......................................119.....476...707.....
...*.....*...*....................*906.*.....................84.....286...............$...=...127.200.465........324.............=.....*599.
905.....762...262.....-597.....847......311......@654...837............*....455..37..439..147....*.....*...262...*.....787..778.............
...........................25...........................=...........908....*.......*................827......%....567....-....#.427..819....
..............................#.$....643=...............................886......243....../.....672..............................*....*.....
...........185*....107.....226..965........$.................756........................808.221...-.../574...541&...+....871...326....349...
......................*.....................841.....=...........*688........177................*....................166....*................
.......189..744......308.......99*391..630/........463......................@...930..........543..........................519...............
..984.%........-.741.......................................522.915+.....769......*................207....976.....158*.......................
....*...............*...............&.331...787........48...........224..*......184........874.......=.....*........................537.....
.....934....*339...829....495.....682...*.............*....+..........*..794..........-430...*....&........848..367....+............*....505
.........175..........................381............270....198......911...................52......642...............45............445......

194
resources/2023/day4.txt Normal file
View File

@@ -0,0 +1,194 @@
Card 1: 24 12 26 39 19 98 74 16 82 77 | 80 11 51 1 74 60 77 68 42 35 39 78 21 12 29 19 25 98 65 91 33 17 59 24 31
Card 2: 33 21 96 64 9 38 65 74 16 91 | 14 51 85 1 64 29 74 18 15 38 13 96 16 88 84 21 95 49 9 27 33 63 65 91 90
Card 3: 31 97 18 93 71 54 24 12 19 87 | 59 96 72 94 4 51 74 84 47 10 57 89 65 37 39 16 31 91 26 85 44 30 24 40 2
Card 4: 77 20 66 48 23 32 76 9 75 89 | 31 57 89 51 8 34 9 59 39 73 4 32 18 77 94 76 29 23 41 27 66 20 40 48 75
Card 5: 25 40 65 27 41 7 1 80 26 47 | 7 25 40 1 16 67 42 34 82 19 58 9 91 6 47 80 36 46 77 27 72 41 26 33 81
Card 6: 92 39 18 64 7 71 48 29 3 38 | 55 29 73 31 15 75 13 71 94 48 78 23 54 7 10 86 34 82 91 85 67 14 57 64 3
Card 7: 67 43 34 90 14 32 38 49 11 75 | 15 11 38 30 32 29 59 73 72 42 1 4 55 71 57 64 19 90 24 78 31 67 49 98 43
Card 8: 70 64 82 4 16 6 19 13 9 29 | 21 93 37 69 24 62 60 3 90 83 8 66 20 34 55 22 6 84 99 50 33 26 65 98 86
Card 9: 31 80 67 81 28 90 23 4 48 86 | 90 80 32 8 15 13 81 63 46 45 50 47 17 96 48 28 57 98 88 86 1 34 4 87 5
Card 10: 40 46 22 70 59 97 32 20 4 65 | 22 25 59 88 30 82 39 91 4 72 9 42 86 65 96 93 5 84 67 40 57 20 36 8 80
Card 11: 53 10 4 91 42 12 32 86 38 60 | 3 60 20 65 85 94 58 38 10 76 44 81 51 6 99 19 31 43 84 95 59 36 86 82 11
Card 12: 73 87 16 92 67 13 28 82 97 86 | 60 45 83 4 90 43 54 55 93 62 7 94 65 72 32 25 23 38 88 61 87 76 35 20 18
Card 13: 92 13 96 89 25 81 80 72 76 48 | 92 32 31 23 61 74 13 95 71 78 17 1 22 86 62 55 60 41 96 11 77 93 63 99 76
Card 14: 8 59 91 73 10 61 65 34 29 81 | 9 32 87 78 26 16 90 49 74 61 56 11 57 93 77 62 75 46 36 59 85 3 19 34 28
Card 15: 87 53 99 88 20 39 28 61 38 68 | 60 16 1 5 10 53 45 56 89 42 80 21 2 37 98 99 74 71 72 59 84 41 87 95 67
Card 16: 2 19 58 83 91 76 9 63 71 77 | 37 3 59 79 72 53 70 9 43 36 97 98 6 85 90 16 55 11 56 1 8 49 52 15 22
Card 17: 29 83 12 76 32 82 40 91 84 97 | 21 79 3 31 1 36 85 17 59 30 87 46 27 63 75 56 72 67 11 42 84 62 53 68 38
Card 18: 39 63 75 71 70 41 49 15 82 78 | 44 74 3 24 35 41 12 47 34 54 91 45 67 57 62 60 95 8 99 19 9 79 80 4 92
Card 19: 82 33 76 22 93 10 49 46 9 63 | 70 79 80 44 92 15 90 31 75 17 54 81 12 21 71 61 45 60 72 87 91 8 65 83 47
Card 20: 60 22 86 1 94 25 72 51 73 57 | 28 66 60 25 16 1 54 36 94 7 73 29 57 55 61 22 51 44 39 69 86 23 72 9 71
Card 21: 6 30 81 11 69 96 45 76 4 78 | 45 96 51 87 65 95 78 82 76 24 32 28 11 50 4 85 74 81 30 33 69 6 34 79 41
Card 22: 91 88 99 7 98 1 34 81 36 44 | 69 98 15 50 22 7 27 56 52 97 66 88 89 5 31 34 99 11 91 36 1 33 44 81 55
Card 23: 94 78 99 13 27 56 81 1 62 84 | 84 33 13 70 81 99 63 56 34 72 64 27 93 87 78 1 29 4 62 44 19 94 37 86 18
Card 24: 8 81 12 30 78 84 33 39 74 20 | 39 51 4 93 62 74 67 75 8 12 28 33 30 99 84 97 95 5 14 1 20 78 81 61 60
Card 25: 79 74 91 69 3 96 42 98 87 82 | 53 92 74 17 25 81 96 61 56 15 59 27 82 97 2 71 68 95 83 13 10 47 41 75 87
Card 26: 20 87 17 34 69 97 36 77 96 66 | 66 10 11 96 83 17 13 57 6 73 88 72 2 39 89 48 79 33 22 19 56 14 9 85 26
Card 27: 18 10 33 21 67 25 7 86 12 72 | 91 53 6 30 85 90 61 20 40 31 23 83 78 72 68 81 63 58 97 42 16 50 79 37 66
Card 28: 96 36 98 66 37 8 78 41 55 7 | 77 70 42 37 74 8 96 76 63 64 93 98 78 30 66 1 9 55 7 41 90 29 4 36 22
Card 29: 51 44 97 56 70 67 82 47 61 60 | 90 94 15 67 75 4 52 21 87 33 77 97 76 20 13 35 45 39 78 82 48 70 89 44 19
Card 30: 57 24 50 79 36 12 45 68 41 14 | 66 90 12 44 29 79 91 73 57 69 68 24 36 56 33 14 1 83 41 45 9 40 60 20 50
Card 31: 61 53 23 10 85 72 62 52 26 57 | 37 50 73 7 77 26 63 23 83 44 29 96 48 91 27 53 34 33 61 72 20 42 10 22 25
Card 32: 76 41 35 73 45 66 54 3 69 12 | 8 2 42 85 28 93 58 89 76 73 84 17 3 56 12 52 68 62 66 54 69 45 41 82 35
Card 33: 32 29 97 52 45 95 92 18 42 47 | 65 97 46 95 96 39 37 16 52 69 45 92 50 17 29 18 1 47 42 77 56 81 71 7 32
Card 34: 26 96 10 87 15 16 84 99 75 4 | 29 53 75 48 91 8 89 30 5 22 21 87 13 36 49 16 25 94 2 41 18 69 70 68 67
Card 35: 57 89 3 81 5 35 32 29 91 65 | 50 68 11 61 39 91 36 31 5 89 12 9 60 13 78 75 4 51 21 45 54 14 73 1 62
Card 36: 80 46 17 70 42 1 63 87 92 98 | 37 18 64 47 46 94 35 2 10 86 91 19 1 80 4 71 5 78 81 52 31 17 92 40 68
Card 37: 22 15 30 2 82 24 76 84 85 5 | 30 85 22 24 77 12 49 84 93 1 82 17 27 47 4 10 2 86 6 63 31 33 60 55 57
Card 38: 63 51 26 56 99 22 32 59 7 3 | 73 11 13 5 37 18 84 35 98 42 4 55 15 58 60 78 22 41 3 89 33 74 93 56 46
Card 39: 5 96 13 31 59 88 87 55 27 11 | 32 46 56 28 43 45 69 27 5 39 91 79 98 63 35 21 29 38 30 82 71 93 49 80 70
Card 40: 62 47 56 14 20 91 86 5 12 33 | 88 65 66 10 17 30 51 63 15 83 3 55 27 28 64 35 7 99 76 68 39 23 48 74 41
Card 41: 48 67 38 82 73 65 1 11 78 53 | 50 76 31 66 11 98 80 29 93 6 82 15 86 74 78 28 60 63 12 59 71 24 68 36 56
Card 42: 91 27 55 36 14 71 45 10 42 5 | 87 44 80 24 43 84 95 99 53 76 33 23 96 20 62 51 72 49 79 78 39 94 74 61 89
Card 43: 81 61 13 78 28 75 58 67 54 11 | 96 51 53 73 76 24 82 85 42 25 93 57 35 91 9 64 99 11 88 79 39 44 74 65 29
Card 44: 82 69 37 22 80 81 55 35 27 19 | 12 63 85 74 39 33 95 75 93 73 44 40 2 76 14 94 42 8 17 9 6 84 34 23 4
Card 45: 20 86 52 74 80 69 53 33 98 41 | 69 51 18 74 98 90 42 97 7 24 41 62 30 58 95 52 5 31 33 53 20 87 38 25 80
Card 46: 67 72 36 1 54 24 86 61 85 52 | 19 22 86 64 41 88 31 72 17 1 21 85 67 29 82 54 36 61 75 56 70 53 95 52 24
Card 47: 62 23 80 46 56 10 52 89 50 5 | 37 55 43 79 98 60 30 44 10 97 38 90 88 83 36 35 61 28 76 21 65 87 40 84 91
Card 48: 11 26 39 71 9 51 86 65 47 13 | 54 23 60 47 26 9 71 13 85 92 39 19 79 14 73 74 45 22 36 15 65 11 63 10 33
Card 49: 25 62 23 78 98 83 33 7 37 10 | 85 81 71 67 83 98 60 35 10 79 33 7 52 89 62 93 87 23 37 11 25 45 78 95 82
Card 50: 98 18 87 92 43 45 67 12 46 69 | 38 74 44 31 89 9 62 53 34 43 41 96 11 4 47 8 5 42 3 95 71 28 73 97 33
Card 51: 72 33 31 38 5 67 25 1 4 79 | 9 77 58 97 48 30 85 91 79 70 49 10 98 76 47 90 89 88 25 5 51 26 99 32 7
Card 52: 92 18 67 66 45 23 10 83 78 57 | 70 17 97 6 9 95 37 4 69 40 93 2 11 12 61 5 30 42 74 7 87 85 20 52 75
Card 53: 4 59 6 44 12 60 14 86 93 11 | 14 44 74 7 87 6 82 84 55 48 17 37 18 60 23 59 97 62 31 4 93 12 11 13 58
Card 54: 2 64 63 60 87 72 33 46 88 92 | 96 5 46 94 92 7 63 93 17 13 25 60 73 55 9 98 20 49 29 57 61 64 48 52 19
Card 55: 29 93 5 53 72 82 12 67 64 50 | 52 33 77 16 45 31 56 28 18 72 79 4 73 41 59 35 2 38 68 98 87 84 94 66 12
Card 56: 26 18 58 78 53 22 94 23 76 93 | 4 36 64 38 26 72 21 53 68 91 17 18 24 78 33 16 5 9 79 2 98 52 99 40 76
Card 57: 85 36 66 93 50 62 90 98 4 31 | 23 6 31 76 79 80 15 38 42 81 85 14 56 88 90 65 50 54 62 78 27 77 35 10 70
Card 58: 80 61 53 48 94 11 87 89 72 43 | 3 55 54 77 57 95 31 7 12 52 92 59 25 23 80 14 45 85 81 94 30 24 67 53 16
Card 59: 78 54 15 18 17 28 89 12 88 81 | 55 51 97 22 32 72 88 73 11 28 8 65 14 20 6 79 41 87 29 2 40 74 17 99 52
Card 60: 64 74 67 76 78 43 6 14 79 96 | 82 23 87 37 51 64 89 15 1 56 86 66 10 9 8 53 2 11 24 88 76 35 54 69 68
Card 61: 53 29 18 65 93 62 75 20 15 35 | 9 77 14 60 38 36 98 24 47 28 6 95 27 12 10 94 61 71 68 22 72 37 96 4 81
Card 62: 43 85 70 78 16 8 3 18 26 67 | 63 86 95 90 15 13 4 31 82 74 34 76 96 14 49 94 55 80 39 84 79 68 54 81 1
Card 63: 9 54 71 62 38 75 3 12 46 8 | 8 12 38 69 9 3 79 16 2 6 54 25 75 71 21 60 29 13 30 50 62 98 46 15 47
Card 64: 98 90 48 49 86 78 45 60 92 81 | 84 67 21 27 37 76 99 1 74 20 23 73 58 10 60 17 57 26 29 86 11 64 31 54 66
Card 65: 45 21 33 32 64 38 90 47 15 35 | 64 82 38 89 21 32 90 33 16 63 54 65 39 15 37 42 96 7 40 26 50 45 30 85 22
Card 66: 95 88 40 57 32 31 89 23 68 17 | 64 94 68 4 55 58 8 6 1 17 88 89 32 95 13 78 93 45 23 40 76 31 96 15 57
Card 67: 15 60 6 79 89 46 67 26 70 29 | 29 79 36 20 1 14 39 2 89 75 67 33 19 12 70 26 9 58 6 35 60 17 15 10 68
Card 68: 76 32 99 77 16 6 17 46 91 42 | 81 42 82 80 91 52 70 90 26 15 45 35 22 27 84 67 16 24 32 76 54 77 75 51 31
Card 69: 34 68 42 21 5 91 47 95 59 63 | 35 59 4 20 47 37 24 95 79 91 49 73 68 6 5 46 63 99 58 21 88 67 94 44 80
Card 70: 69 11 94 64 21 65 31 89 55 28 | 5 64 99 53 34 4 51 88 10 68 74 81 1 23 29 58 93 94 43 32 70 76 7 77 21
Card 71: 29 52 43 97 41 83 86 99 49 45 | 86 29 43 89 42 53 82 17 94 62 52 99 15 27 40 49 78 74 77 28 9 10 88 97 68
Card 72: 48 11 62 26 1 89 61 3 23 6 | 11 54 93 60 43 3 24 77 48 61 32 5 79 91 21 73 62 96 87 6 89 59 26 1 15
Card 73: 65 45 90 13 71 50 48 97 54 77 | 97 16 45 87 68 32 12 15 21 7 33 64 37 88 67 10 60 26 49 65 20 11 29 44 52
Card 74: 83 54 74 80 4 60 8 68 35 18 | 71 81 31 11 5 60 77 90 76 58 64 32 82 21 97 2 53 9 10 85 75 18 55 86 25
Card 75: 13 19 42 14 17 74 28 34 56 93 | 76 83 33 82 28 86 93 29 39 88 98 14 49 89 74 62 13 23 43 17 42 56 45 41 35
Card 76: 51 79 58 45 42 65 29 96 36 13 | 82 99 23 66 29 69 92 95 64 13 40 45 76 86 74 44 81 73 10 4 30 79 68 1 12
Card 77: 98 12 89 28 29 87 92 4 13 85 | 24 47 4 76 9 95 29 80 87 16 53 85 7 42 86 82 59 37 28 35 55 40 50 10 58
Card 78: 98 59 89 56 30 15 51 64 4 95 | 74 92 70 91 45 94 95 58 79 88 87 63 40 54 50 77 31 30 41 17 43 82 4 44 13
Card 79: 37 35 51 39 10 79 32 56 40 42 | 53 28 38 36 76 83 2 42 35 90 6 84 49 27 47 64 75 39 89 52 3 17 40 87 93
Card 80: 80 42 36 87 9 50 40 96 27 16 | 6 65 3 69 85 63 30 18 8 77 11 94 53 55 5 20 66 33 32 13 49 89 19 83 70
Card 81: 20 51 80 10 71 43 94 87 7 55 | 44 1 59 33 27 57 28 17 77 46 11 72 73 54 65 37 25 74 60 41 98 84 22 58 79
Card 82: 13 87 41 55 28 79 7 2 22 37 | 8 20 91 72 53 65 96 54 44 42 90 79 97 31 75 67 21 93 62 81 82 3 11 58 73
Card 83: 99 2 35 20 25 41 46 88 23 37 | 6 89 28 32 36 93 62 78 61 53 58 16 5 98 67 15 1 24 80 83 31 76 33 82 73
Card 84: 13 5 98 70 63 92 79 10 53 84 | 32 10 41 63 92 40 85 53 88 57 13 5 70 93 96 54 29 30 44 22 98 84 79 21 78
Card 85: 20 32 69 15 1 29 2 87 45 10 | 43 15 36 7 32 95 91 90 75 45 6 65 10 62 20 1 2 73 72 51 85 25 29 33 49
Card 86: 74 56 19 8 4 35 78 43 75 26 | 74 30 77 56 42 14 19 1 28 18 16 99 63 72 8 90 43 15 20 4 78 23 35 75 26
Card 87: 40 16 56 70 55 65 23 24 78 47 | 59 56 55 29 64 91 42 93 96 54 13 67 14 20 23 76 6 60 63 21 27 61 85 10 15
Card 88: 50 48 45 15 51 65 97 22 12 39 | 59 93 75 12 30 39 5 85 32 56 29 50 80 82 21 38 96 65 14 53 62 51 15 23 54
Card 89: 89 77 17 59 37 15 50 63 40 60 | 44 63 77 40 74 15 37 62 43 24 32 81 55 98 86 16 71 75 84 54 76 67 42 90 10
Card 90: 63 97 57 10 38 19 42 69 73 56 | 3 89 60 13 33 24 70 97 27 56 15 21 19 83 63 42 36 68 57 38 10 73 77 17 5
Card 91: 13 62 75 45 36 96 69 50 73 74 | 86 7 13 52 60 22 91 14 67 62 85 54 21 32 75 2 55 69 40 42 77 57 9 84 41
Card 92: 54 97 73 17 67 58 69 27 21 7 | 38 66 59 27 69 7 71 68 83 2 58 44 11 89 10 75 70 63 61 73 94 5 41 45 17
Card 93: 52 51 28 93 45 31 90 25 53 60 | 31 65 24 87 74 54 66 69 30 7 50 52 9 93 16 51 53 95 18 22 8 90 99 97 43
Card 94: 73 17 53 21 91 3 85 89 36 92 | 53 57 5 44 55 90 74 20 51 77 41 81 75 31 63 23 76 18 48 82 45 40 9 37 54
Card 95: 5 88 23 61 63 38 78 82 42 45 | 45 26 5 91 71 40 4 1 94 47 14 55 10 95 81 44 25 24 78 20 3 43 61 50 66
Card 96: 70 85 30 35 56 69 83 47 18 33 | 6 93 99 79 52 5 69 48 57 85 4 11 9 22 43 53 87 21 33 56 39 31 83 32 67
Card 97: 52 27 4 63 32 54 89 45 19 40 | 86 50 2 75 72 79 23 85 12 60 34 76 15 55 17 68 90 78 14 95 41 26 33 38 24
Card 98: 89 50 13 23 47 26 27 90 92 24 | 45 74 96 24 40 46 23 17 76 15 53 25 29 27 92 58 20 12 37 35 72 10 32 47 26
Card 99: 12 47 10 35 30 8 57 83 84 39 | 73 98 81 88 34 52 33 8 86 55 47 83 84 66 23 29 62 21 70 1 64 49 53 15 94
Card 100: 45 99 97 10 17 5 44 54 96 88 | 95 91 34 50 61 15 81 20 99 14 69 33 48 75 16 9 29 98 41 80 53 77 89 56 72
Card 101: 20 85 57 67 47 54 58 65 95 32 | 49 88 10 23 48 93 85 95 69 75 38 25 78 45 12 80 26 14 32 24 8 21 99 77 1
Card 102: 52 32 10 58 7 99 74 1 59 50 | 29 97 91 78 53 11 96 25 79 43 77 72 60 66 81 55 69 93 50 48 98 54 39 87 10
Card 103: 28 95 73 79 26 5 60 56 40 59 | 49 14 29 94 69 86 82 85 1 83 81 54 8 43 71 99 32 35 78 5 87 57 15 44 48
Card 104: 68 70 17 29 85 16 48 21 2 34 | 14 45 36 72 99 94 62 37 74 84 97 75 31 35 83 19 1 15 91 57 61 40 79 77 5
Card 105: 18 33 10 82 88 2 61 81 41 15 | 33 34 15 1 82 63 77 3 57 67 10 88 93 13 84 39 68 5 54 96 64 41 7 18 4
Card 106: 67 56 16 10 80 60 62 61 64 51 | 51 10 21 64 71 80 9 98 67 4 60 45 16 85 92 27 56 91 61 43 62 68 1 77 35
Card 107: 58 50 49 28 39 22 8 63 72 1 | 25 45 9 7 88 71 94 3 54 66 27 85 32 1 8 10 22 84 69 92 86 39 61 50 49
Card 108: 41 38 72 4 70 66 61 87 42 83 | 69 99 89 43 50 15 5 29 68 28 86 37 66 38 27 19 95 41 62 82 2 87 33 20 42
Card 109: 85 35 69 74 73 23 29 31 11 92 | 33 36 29 28 92 87 70 62 5 24 95 38 11 48 47 75 81 35 51 15 94 90 32 78 13
Card 110: 86 6 55 64 15 23 66 51 77 67 | 51 44 89 73 22 29 58 17 77 48 18 53 75 91 57 60 30 63 96 93 33 79 68 86 12
Card 111: 34 40 48 88 11 4 2 41 39 66 | 15 47 42 81 4 24 52 10 13 34 90 2 79 45 99 96 31 92 23 63 11 76 44 73 70
Card 112: 34 74 86 79 37 30 31 51 41 13 | 75 21 14 78 1 93 60 96 56 77 65 29 34 58 22 90 79 59 8 19 42 46 33 2 4
Card 113: 50 16 13 39 17 98 73 48 30 66 | 37 41 97 57 6 91 99 86 78 5 94 85 15 88 3 83 21 26 16 98 51 27 60 46 50
Card 114: 36 74 72 70 13 27 42 21 8 65 | 39 27 16 94 75 5 87 66 51 68 72 67 85 19 21 91 65 10 56 86 84 40 83 36 43
Card 115: 55 68 47 93 44 19 40 33 69 51 | 20 89 33 84 77 79 10 14 26 43 16 78 37 41 62 49 95 3 30 82 5 18 50 86 69
Card 116: 40 7 60 18 17 94 24 12 79 59 | 91 22 74 80 35 10 20 97 25 78 24 95 18 70 26 33 8 41 71 32 77 15 72 86 61
Card 117: 53 5 43 22 37 55 42 62 87 50 | 24 57 27 11 17 20 83 86 81 18 21 42 79 62 69 25 88 36 13 65 78 80 28 93 7
Card 118: 49 76 39 26 97 89 9 2 79 40 | 77 99 93 86 89 3 24 47 52 13 19 6 44 25 73 71 70 34 46 28 97 61 92 35 20
Card 119: 35 97 25 47 40 18 86 45 64 38 | 83 33 66 73 58 22 14 77 45 16 98 61 63 99 4 40 72 30 50 46 51 44 49 84 70
Card 120: 86 99 32 14 39 90 15 6 89 76 | 56 18 35 31 5 83 68 42 47 36 33 81 69 43 46 20 97 53 94 60 23 71 26 24 52
Card 121: 53 39 83 9 7 59 20 14 17 93 | 92 78 49 16 62 3 60 29 48 88 56 33 68 64 15 35 99 94 55 41 77 74 90 11 86
Card 122: 39 62 24 68 36 29 38 15 96 76 | 79 99 71 75 70 43 20 21 41 82 7 17 9 57 85 8 33 30 80 26 93 63 12 5 54
Card 123: 34 53 21 57 84 19 45 62 50 4 | 27 59 88 78 36 3 22 28 29 10 54 9 48 47 76 91 25 13 96 8 11 42 46 74 40
Card 124: 51 30 87 45 39 11 33 94 22 65 | 11 30 18 39 2 33 90 87 37 72 51 81 67 45 78 48 14 94 56 27 65 22 20 10 76
Card 125: 94 87 72 21 28 6 59 60 61 35 | 46 92 59 4 60 76 71 3 53 35 8 86 51 72 47 73 25 28 87 55 43 63 21 66 50
Card 126: 77 83 56 19 75 12 58 54 64 90 | 18 53 50 77 44 57 74 64 61 65 62 5 91 85 26 1 66 71 41 68 92 69 27 9 93
Card 127: 2 14 39 77 97 63 33 24 46 35 | 8 79 91 46 28 66 58 75 80 73 85 34 2 95 33 38 35 69 67 26 23 63 78 87 97
Card 128: 23 78 35 17 80 32 90 34 30 63 | 42 80 4 32 37 27 8 23 40 65 17 41 43 90 34 81 35 63 83 46 30 78 72 55 82
Card 129: 77 84 23 99 78 95 40 4 55 56 | 46 49 44 65 36 66 94 64 34 16 30 81 62 77 82 28 31 18 86 32 74 75 88 99 71
Card 130: 50 93 25 12 24 66 38 29 46 76 | 99 27 29 84 66 7 47 34 93 4 60 24 25 46 12 9 33 86 38 69 76 48 81 85 21
Card 131: 89 68 69 30 59 72 26 70 42 51 | 78 74 18 68 89 22 72 40 67 34 84 39 43 76 81 63 30 54 36 24 51 98 1 19 59
Card 132: 70 73 4 37 15 86 65 7 77 85 | 79 21 5 55 81 99 25 27 94 33 40 34 20 29 68 93 98 16 90 54 71 13 78 60 74
Card 133: 11 89 21 87 56 1 70 79 36 63 | 18 59 80 62 76 39 25 27 53 48 45 47 89 2 85 55 91 15 84 31 33 64 28 30 8
Card 134: 69 96 77 54 67 24 46 22 81 42 | 79 73 45 14 97 39 61 74 95 58 82 43 89 2 4 36 21 78 37 51 65 47 53 99 20
Card 135: 33 92 5 46 16 18 10 32 77 67 | 72 30 76 7 33 64 18 54 6 85 73 3 68 96 92 45 61 32 88 56 87 42 39 84 86
Card 136: 27 53 79 82 18 4 75 63 11 39 | 66 55 93 24 58 83 33 92 61 68 26 72 80 49 8 36 22 43 63 20 84 69 21 97 88
Card 137: 22 50 61 6 94 62 90 73 25 46 | 66 99 72 17 77 57 6 73 48 34 5 58 13 16 2 36 35 23 78 42 12 27 24 29 37
Card 138: 18 19 59 57 23 68 61 78 91 65 | 2 4 83 10 20 85 51 73 30 1 31 9 80 27 24 92 3 42 71 67 84 54 82 45 76
Card 139: 23 41 36 48 93 74 10 73 6 18 | 47 84 14 89 62 39 37 94 15 46 97 98 29 17 72 32 64 31 99 76 86 45 75 61 5
Card 140: 99 71 15 31 61 53 4 62 69 77 | 58 8 86 44 59 47 91 38 30 25 42 82 11 19 49 75 9 83 20 90 1 94 12 22 52
Card 141: 55 87 74 50 52 9 76 90 73 25 | 39 50 27 56 57 70 66 92 24 23 32 72 45 75 31 78 74 99 8 79 1 43 5 2 53
Card 142: 28 66 34 64 49 48 91 73 81 41 | 54 78 66 59 32 43 41 85 15 64 68 56 4 46 90 67 63 45 24 16 53 74 52 75 81
Card 143: 30 38 11 31 66 26 40 93 88 14 | 30 88 31 15 93 27 55 96 11 17 20 35 14 10 66 51 40 18 57 53 24 9 26 58 38
Card 144: 70 6 21 59 69 99 30 43 60 58 | 60 1 11 69 70 59 66 79 58 73 54 30 33 55 21 89 14 43 99 4 52 82 6 2 96
Card 145: 25 44 26 89 81 7 57 40 59 9 | 95 20 38 12 57 32 80 34 25 94 40 59 9 65 93 68 42 86 44 89 81 7 70 26 62
Card 146: 90 61 87 20 26 51 33 19 64 10 | 1 84 80 86 22 50 73 69 78 70 12 34 65 54 5 83 44 98 82 57 31 3 37 59 79
Card 147: 73 32 37 22 42 83 17 20 61 76 | 76 87 22 61 45 48 83 32 60 3 17 8 70 95 12 1 73 40 82 85 65 20 37 42 88
Card 148: 16 40 86 29 68 67 22 42 96 9 | 34 83 95 91 40 11 74 99 25 16 15 76 52 12 75 43 92 59 17 98 88 36 4 5 28
Card 149: 17 85 45 10 60 72 15 50 61 63 | 85 11 92 50 10 8 37 23 96 20 69 15 40 72 89 60 61 17 54 63 27 28 31 24 45
Card 150: 64 87 43 20 97 83 69 61 95 56 | 29 76 26 52 65 84 62 11 49 92 90 77 47 46 42 50 33 37 98 2 5 9 71 22 85
Card 151: 12 23 35 44 39 73 1 30 95 33 | 36 10 58 60 72 6 43 64 75 1 16 93 15 89 68 56 99 88 32 52 18 22 98 67 66
Card 152: 69 85 51 1 46 21 31 19 44 49 | 45 92 8 10 80 94 32 33 88 28 16 86 23 93 6 96 25 81 3 52 64 90 76 95 59
Card 153: 42 74 39 36 45 26 25 1 68 12 | 70 33 74 79 96 1 4 88 34 76 59 61 75 27 92 72 57 98 51 10 29 52 64 26 35
Card 154: 85 95 68 79 28 93 46 65 38 14 | 52 18 50 9 79 2 88 43 85 31 83 74 21 38 87 73 56 63 71 15 59 72 13 64 46
Card 155: 11 43 73 53 49 65 27 37 30 51 | 27 28 23 51 61 54 71 57 88 1 40 65 34 53 73 83 24 82 15 32 46 11 79 77 80
Card 156: 64 26 5 45 59 81 23 43 27 44 | 11 16 77 37 62 98 10 21 71 35 28 13 74 65 89 78 45 61 96 7 12 53 51 52 44
Card 157: 27 87 50 60 44 48 85 1 33 8 | 84 41 4 36 8 49 26 43 52 95 77 3 75 72 54 66 98 21 19 61 18 78 30 37 1
Card 158: 31 88 37 91 12 56 65 79 95 17 | 64 32 43 1 45 8 99 94 39 16 77 18 84 70 24 51 27 93 59 25 41 73 78 34 44
Card 159: 88 86 84 17 93 64 3 14 59 32 | 37 21 60 95 23 62 45 98 56 78 20 81 99 22 12 57 5 36 51 10 93 72 58 8 13
Card 160: 49 37 23 63 73 64 16 70 19 32 | 75 74 21 77 37 56 30 76 66 1 51 9 97 95 38 40 29 69 67 6 47 50 45 71 87
Card 161: 10 67 21 27 39 79 22 92 47 42 | 9 80 82 75 20 2 53 64 76 96 31 61 50 12 16 15 38 18 90 59 65 70 55 99 6
Card 162: 89 99 28 87 4 43 30 48 46 82 | 46 51 59 81 14 40 82 5 85 48 97 28 11 7 87 64 58 38 92 30 89 99 27 36 34
Card 163: 2 91 88 95 38 31 92 3 27 60 | 76 31 38 29 60 68 22 87 71 11 95 48 50 21 88 26 44 32 2 69 27 45 94 79 81
Card 164: 87 91 47 40 2 71 95 99 49 74 | 34 8 65 49 45 43 51 81 9 13 80 38 33 88 82 74 28 60 91 48 1 55 42 95 56
Card 165: 57 74 54 91 94 96 55 64 39 75 | 67 9 10 80 75 77 12 87 95 50 25 19 82 65 76 66 23 30 45 61 79 17 72 37 7
Card 166: 16 4 73 97 28 19 17 10 57 43 | 73 97 24 57 43 58 72 10 2 34 9 63 70 64 68 28 44 16 99 61 4 78 46 83 19
Card 167: 53 51 67 68 18 26 55 10 69 9 | 46 64 73 12 97 89 67 22 30 82 14 27 36 4 72 19 61 13 93 24 91 63 48 21 87
Card 168: 69 32 33 90 72 88 55 80 15 27 | 10 80 14 55 64 39 97 82 24 96 74 46 73 68 65 87 43 59 16 53 84 38 79 11 47
Card 169: 74 85 11 55 15 59 36 5 54 18 | 31 27 42 86 93 33 68 45 40 32 44 88 48 47 35 25 9 89 49 66 39 1 79 69 7
Card 170: 9 49 3 88 4 31 13 64 38 41 | 71 38 32 13 91 61 3 48 88 63 17 19 59 75 98 36 6 49 50 44 20 2 45 67 53
Card 171: 67 87 77 34 32 64 56 59 58 36 | 50 74 68 64 22 63 38 12 73 32 10 14 29 55 31 92 91 9 76 24 17 49 33 95 2
Card 172: 4 80 72 36 37 99 64 16 22 31 | 8 78 95 47 18 36 55 59 23 86 70 54 60 98 13 25 80 75 74 48 16 7 81 5 11
Card 173: 4 77 32 71 39 67 58 11 57 29 | 87 31 69 92 71 62 20 77 14 47 60 57 75 94 37 86 95 97 41 85 30 54 48 44 10
Card 174: 21 12 8 71 74 77 31 82 1 16 | 4 89 75 19 91 51 10 71 88 78 30 80 47 96 28 65 99 35 13 48 73 29 53 49 42
Card 175: 58 38 44 98 56 18 21 63 74 3 | 92 55 64 94 49 41 10 78 6 53 76 70 45 46 83 63 82 73 95 81 33 30 77 50 34
Card 176: 94 39 50 86 44 81 88 55 54 9 | 16 60 84 75 52 81 4 10 37 6 56 14 22 8 90 41 45 70 12 23 89 31 28 80 87
Card 177: 96 26 47 79 99 4 66 50 53 45 | 9 94 70 72 81 75 76 77 64 78 12 32 85 40 20 90 28 3 35 57 93 87 63 17 54
Card 178: 33 65 93 44 97 37 12 41 83 24 | 2 1 46 10 55 82 58 57 52 64 81 76 74 99 5 89 9 14 42 27 6 19 66 3 15
Card 179: 12 28 65 24 9 30 38 11 18 55 | 85 10 70 62 71 19 55 67 68 25 44 95 51 91 29 30 15 13 90 52 47 23 21 66 92
Card 180: 65 7 39 97 64 3 50 27 46 4 | 12 59 88 91 43 61 36 18 58 85 26 5 23 1 62 56 8 49 66 72 9 67 90 52 95
Card 181: 13 97 85 12 18 20 70 6 93 44 | 25 12 54 97 68 65 23 26 13 8 50 62 10 32 73 88 51 76 98 16 37 4 87 18 35
Card 182: 65 35 63 2 34 77 15 89 16 54 | 36 2 6 62 81 58 34 99 54 48 57 15 52 16 30 65 83 53 38 10 41 77 63 35 21
Card 183: 16 98 38 2 86 34 85 48 50 95 | 34 50 2 14 89 6 47 44 67 25 86 98 17 48 85 99 51 16 55 35 38 66 95 32 90
Card 184: 4 1 48 73 89 69 47 81 94 59 | 20 18 50 30 87 17 99 76 74 61 9 84 40 46 51 97 65 98 56 53 3 77 11 8 34
Card 185: 79 72 33 15 36 89 13 90 94 28 | 58 96 94 83 84 90 52 53 31 9 17 97 2 54 56 26 20 76 98 91 1 14 74 23 64
Card 186: 36 34 86 79 32 64 15 94 72 35 | 12 94 19 11 35 78 59 91 86 47 55 36 53 21 9 45 77 18 17 72 10 79 49 34 74
Card 187: 43 16 88 54 62 17 93 91 21 59 | 51 7 46 16 26 6 96 30 42 2 10 55 37 48 74 89 98 73 84 19 9 11 24 44 69
Card 188: 50 59 97 84 11 57 7 94 29 92 | 19 79 94 25 18 55 24 89 65 11 53 93 83 92 27 85 48 4 68 97 46 64 40 1 74
Card 189: 17 19 78 66 96 13 84 16 59 53 | 15 30 24 55 62 12 51 87 35 73 33 8 2 94 49 52 58 75 32 34 69 16 74 89 46
Card 190: 61 96 6 49 37 3 26 12 99 11 | 87 95 57 43 23 53 36 25 84 69 38 67 46 92 74 16 18 27 80 19 13 54 12 39 61
Card 191: 85 69 8 21 84 42 68 22 55 45 | 10 51 26 7 27 9 18 76 46 57 20 59 77 38 92 49 90 52 98 78 34 37 74 91 12
Card 192: 58 46 36 50 72 87 96 63 83 5 | 69 11 88 81 52 97 43 42 26 41 47 54 78 67 51 95 18 62 13 99 30 3 34 89 53
Card 193: 20 78 41 3 26 1 29 63 4 88 | 64 59 80 93 66 18 62 94 23 25 79 53 52 31 44 46 67 75 24 8 97 10 51 99 84
Card 194: 40 5 28 23 65 78 63 94 60 83 | 45 54 2 74 75 11 55 8 68 41 30 51 47 33 88 58 37 36 64 1 21 72 77 25 99

View File

@@ -0,0 +1,6 @@
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53
Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19
Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1
Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11

210
resources/2023/day5.txt Normal file
View File

@@ -0,0 +1,210 @@
seeds: 3416930225 56865175 4245248379 7142355 1808166864 294882110 863761171 233338109 4114335326 67911591 1198254212 504239157 3491380151 178996923 3965970270 15230597 2461206486 133606394 2313929258 84595688
seed-to-soil map:
3534435790 4123267198 50004089
3584439879 3602712894 238659237
2263758314 0 160870825
2971481857 2850687195 31776688
4173604159 3353763588 121363137
3823099116 3003258545 350505043
2850687195 2882463883 120794662
1503174517 2076905328 347723811
1850898328 195477286 412859986
1265521310 1606247567 17062682
3285153612 4173271287 121696009
488201540 828927797 777319770
453595079 160870825 34606461
3406849621 3475126725 127586169
1282583992 608337272 220590525
3003258545 3841372131 281895067
0 1623310249 453595079
soil-to-fertilizer map:
131427930 1185330183 180485664
748806267 2475960003 160820884
311913594 3858074623 436892673
3738185633 2255483282 220476721
909627151 2636780887 1221293736
2848518198 1365815847 889667435
2130920887 131427930 666553095
2797473982 1134285967 51044216
3958662354 797981025 336304942
fertilizer-to-water map:
318410581 1095359367 168721315
1850530626 4267113166 11515024
1868157768 2129267011 114327162
3662276437 4191001581 22313216
2980811924 3765310336 180818294
3971289879 3991326516 15449292
4217905563 2279561459 35118050
2287003279 4213314797 47187938
1837473204 2314679509 13057422
1998824036 3946128630 45197886
222462505 1264080682 95948076
487131896 791770420 303588947
4253023613 4068573955 41943683
2334191217 3252696905 278223677
3986739171 2786104784 83568826
3495640623 3600917310 61383314
3557023937 3662300624 15042395
2222048360 3535962391 64954919
2919013777 4006775808 61798147
3660033649 4182646675 2242788
3266573705 2327736931 229066918
3684589653 2869673610 235425729
3261531896 3530920582 5041809
790720843 417781090 105163807
895884650 0 159434487
2044021922 2608078346 178026438
1862045650 4184889463 6112118
3572066332 3677343019 87967317
1830862773 4260502735 6610431
1338009275 159434487 258346603
3233759255 1830862773 27772641
1055319137 1360028758 282690138
1982484930 4278628190 16339106
2883046491 2243594173 35967286
2612414894 1858635414 270631597
4070307997 3105099339 147597566
3161630218 4110517638 72129037
1596355878 522944897 46363018
0 569307915 222462505
3920015382 2556803849 51274497
water-to-light map:
3185219492 1324735395 185266775
3146586681 1249776213 38632811
28244350 428471809 312696716
340941066 3650819202 117391304
458332370 963661621 286114592
2785969088 3483794777 117695215
1279106820 1583617352 194624401
1473731221 3601489992 49329210
0 2796264154 28244350
744446962 3356330358 127464419
2562107674 223281414 205190395
3544929092 0 223281414
2767298069 944990602 18671019
2903664303 775683406 169307196
3072971499 1510002170 73615182
1140236238 741168525 34514881
1242780449 1288409024 36326371
1523060431 1778241753 949993071
871911381 3088005501 268324857
3370486267 2913562676 174442825
4096117687 4180659844 114307452
1174751119 2728234824 68029330
4210425139 4096117687 84542157
2473053502 2824508504 89054172
light-to-temperature map:
57304962 1726059676 351776583
1567802332 965133212 510033927
3296678005 3095070487 435408435
2476702913 3609026358 293401880
1363411758 0 204390574
1017340727 204390574 346071031
2770104793 2148583721 409359530
994650876 1475167139 22689851
0 550461605 20445762
20445762 1692752937 33306739
2144982382 2092188566 56395155
799754929 1497856990 194895947
53752501 961580751 3552461
409081545 570907367 390673384
2201377537 3902428238 275325376
3988154754 2557943251 306812542
3179464323 4177753614 117213682
3732086440 3530478922 78547436
3810633876 2864755793 177520878
2092188566 3042276671 52793816
temperature-to-humidity map:
18928354 3414191527 36074961
3774151818 3588716061 144651966
2046448856 1384376044 7569690
2737178317 903028814 27883660
2981004508 930912474 349046239
1609626976 3084565214 120015958
2765061977 2248931514 215942531
157942811 3887783726 359543023
3330050747 2195105292 25002873
2041971091 78356652 4477765
1938796124 861459710 41569104
1608860129 2474627144 766847
1812604664 3795542966 74143188
4196563819 3386335999 27024746
1980365228 3204581172 61605863
1136292153 82834417 94266783
4015908448 1279958713 104417331
2701246339 2062523244 35931978
4223588565 3286123619 23738184
91521115 3309861803 56668597
1886747852 2552562071 52048272
1729642934 0 61644451
1791287385 1504576228 21317279
517485834 1726582276 261020280
2192468119 2604610343 479954871
1413642666 1391945734 112630494
71715516 3366530400 19805599
3918803784 2475393991 77168080
1546685190 3733368027 62174939
2672422990 2220108165 28823349
148189712 2464874045 9753099
18097572 3413360745 830782
0 3869686154 18097572
3995971864 3266187035 19936584
853426802 432206724 27759827
2054018546 3450266488 138449573
881186629 177101200 255105524
778506114 1987602556 74920688
1526273160 2098455222 20412030
55003315 61644451 16712201
3355053620 459966551 401493159
4120325779 2118867252 76238040
1230558936 1525893507 183083730
3756546779 1708977237 17605039
humidity-to-location map:
166973311 827072705 21017988
2420657564 1797988486 98294592
3711057743 1724407580 50543704
151140540 331672683 15832771
2611368935 1098267426 35837870
329110209 0 39413233
848395356 3293184115 2008343
850403699 1508109908 216297672
3203490893 3278069000 15115115
1322210923 4179894531 115072765
3761601447 848395356 249872070
230668724 39413233 27530262
1437283688 2240143464 113813014
1551096702 2957294790 77256502
716039283 695021295 132051410
258198986 109620920 70911223
1314022212 2357817442 8188711
2793895840 2474472017 281155944
385486933 347505454 330552350
3218606008 3561131747 206517169
1066701371 3354107909 156810008
4011473517 1134105296 283493779
0 180532143 151140540
368523442 678057804 16963491
1223511379 1417599075 90510833
3183517648 1988699857 19973245
2270463718 4038012896 141881635
1817187310 1774951284 23037202
1963899457 2755627961 201666829
2412345353 3295192458 8312211
1840224512 3767648916 123674945
187991299 66943495 42677425
2518952156 1896283078 92416779
1628353204 3034551292 138620276
3075051784 2366006153 108465864
3660454503 3303504669 50603240
3425123177 2008673102 231470362
3656593539 2353956478 3860964
1766973480 3510917917 50213830
2647206805 3891323861 146689035
2165566286 3173171568 104897432

View File

@@ -0,0 +1,33 @@
seeds: 79 14 55 13
seed-to-soil map:
50 98 2
52 50 48
soil-to-fertilizer map:
0 15 37
37 52 2
39 0 15
fertilizer-to-water map:
49 53 8
0 11 42
42 0 7
57 7 4
water-to-light map:
88 18 7
18 25 70
light-to-temperature map:
45 77 23
81 45 19
68 64 13
temperature-to-humidity map:
0 69 1
1 0 69
humidity-to-location map:
60 56 37
56 93 4

2
resources/2023/day6.txt Normal file
View File

@@ -0,0 +1,2 @@
Time: 57 72 69 92
Distance: 291 1172 1176 2026

1000
resources/2023/day7.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
32T3K 765
T55J5 684
KK677 28
KTJJT 220
QQQJA 483

768
resources/2023/day8.txt Normal file
View File

@@ -0,0 +1,768 @@
LRRRLRRLRRLRLRRLRRRLLRRLLRRLRRRLRLRRLLRRLRRLRLRRRLRRRLRLRLRLRRRLRRLRRRLRLRRLLLRLRLLRLRRRLRLRRRLRRRLLLRRLRLRRLRRRLLRRLRRLRRLRRRLRRLRRLRRLRLRRLRLRLRLRLRLRRRLRRLRLLLRRRLRLRRRLRRRLLRRLRRRLRRLRRRLRRRLRLRRRLRRLRLLRRLLRLRRLRLRLLRRLLRRLLRRLRRLRRRLRLRRLRLRRRLRRRLLRLRRLLLLRRRLLRLLLRRLRRRLRRRLRRRLRLRRRLRRRLRRRLRLRRRR
FJT = (XDJ, LQV)
VLP = (BJP, TTH)
NVD = (KTC, TGT)
VCC = (SRV, GMR)
PNM = (SFQ, XMX)
DPD = (HHJ, MGG)
GQA = (BGC, BHR)
VQH = (RCV, VJC)
VHR = (GLQ, GJF)
SQC = (CDT, HKV)
GSV = (PKP, RMP)
JLZ = (KMM, QCG)
THG = (PTL, SXP)
FTC = (VFH, TPL)
JTT = (VQC, QVC)
KQC = (RCR, TRT)
RGP = (DPG, MFQ)
TDP = (XJV, QCR)
PCC = (LRD, XXR)
MRQ = (PPS, KHB)
TTX = (VSJ, XPN)
JNR = (DFB, NSV)
KJK = (PCR, LMT)
JLB = (GXB, HND)
BJN = (KNX, NXQ)
VDV = (XNB, DTB)
TXB = (DXL, PCN)
MJS = (NQK, PDV)
RPV = (BNF, QNS)
CLM = (KLR, QCT)
SXP = (JMV, MGN)
HQG = (LNV, RTX)
RQJ = (HQG, TSJ)
LGD = (PNM, RHG)
XPN = (LGC, CTR)
JJB = (CDH, TXV)
HVZ = (QRH, VHK)
LSV = (FRK, LXV)
RFH = (KMJ, DKH)
FFV = (DJK, MCR)
BMN = (HLV, NMQ)
RBC = (FVH, CXN)
PVK = (HKJ, LGD)
BHK = (MLL, JCP)
VJF = (DCM, SGJ)
XVB = (QBS, MNF)
NRT = (GLL, GLL)
NXL = (CRV, PQB)
TVC = (RKR, PVD)
LDX = (TKH, BHK)
JPG = (DMK, HHQ)
PHV = (JJS, CKP)
NVQ = (RRC, SHR)
KJH = (JKQ, CCR)
LHV = (MVL, LNK)
BBK = (NMH, SQL)
NXP = (PCH, CNJ)
STL = (LMR, HRB)
CFK = (NGC, KFK)
FGC = (VJM, JPG)
SFQ = (CXR, LCT)
KDN = (JPS, QBJ)
PCR = (DSB, TLL)
JKQ = (MRR, JFS)
FNS = (XNB, DTB)
BBP = (LTR, VLP)
MGN = (RKL, RMN)
HCM = (XPC, PHB)
RNJ = (QVC, VQC)
HVT = (FTN, JJQ)
NGP = (JSJ, TKR)
XBL = (BTH, JXS)
AAA = (GFB, FBF)
HXN = (SMM, RVJ)
CMF = (FJT, QMT)
XLR = (HBL, RXC)
NNK = (RCR, TRT)
HNM = (HKN, KBP)
CNN = (JCX, PXH)
VSF = (QFN, HTG)
MQM = (SSQ, QTS)
NBM = (TPD, CVS)
LJB = (SMK, KJK)
VTD = (NGG, NGG)
BCH = (FXM, BPK)
VJM = (DMK, HHQ)
TVX = (HJP, XSP)
TFD = (TSD, TSD)
XDR = (XPS, RDX)
XPD = (VBR, JLN)
TSJ = (RTX, LNV)
NQK = (FVP, NXF)
DCC = (QJL, QFQ)
HKB = (XBH, RXS)
MCR = (RTL, LSC)
GFB = (PND, KRM)
CVM = (JSH, CMP)
QXK = (VTD, XTD)
QFG = (TVX, TCJ)
GQH = (JLB, SFN)
NPB = (PRQ, MLJ)
LRD = (VDV, FNS)
QBJ = (FTV, QNM)
TBB = (FKD, LKP)
HBL = (VMF, DQJ)
HVC = (PQR, BXX)
TQC = (LNK, MVL)
KFQ = (PBK, KPD)
TRH = (SQD, CHT)
TMT = (RSP, SLD)
JBM = (XJV, QCR)
BXX = (NDN, SHC)
JFM = (GVJ, HLH)
PPP = (HGX, JJT)
DXG = (NPK, SBC)
KDQ = (QKD, XRD)
CDH = (XGJ, RGP)
XMX = (CXR, LCT)
PQN = (CKP, JJS)
VDX = (FRP, KJZ)
FRK = (SBT, HCQ)
TDG = (QTM, SVX)
JSD = (HHN, TJM)
JJS = (TTX, MSV)
ZZZ = (FBF, GFB)
XSP = (JXG, CCD)
GXX = (RQX, NGP)
VTG = (QHF, PPP)
BGC = (RQR, PPG)
MQV = (BDT, RMH)
DKH = (PDS, FGF)
XCA = (VHR, HCS)
GTC = (JSM, PTT)
JVV = (LFG, MQV)
TPP = (RBJ, ZZZ)
SRV = (TFV, LBT)
RPC = (FSM, FQF)
CDD = (SQX, QKV)
QHQ = (PVD, RKR)
QCR = (FXJ, LLB)
VDJ = (NMD, BVB)
VLF = (XHR, JRG)
PDS = (NPB, QHS)
TVM = (DQH, XPD)
SJF = (DXL, PCN)
TPD = (VLG, FGC)
SNM = (MHV, FSN)
SGJ = (CDV, BCH)
TPL = (NRT, FNP)
NBF = (DQH, XPD)
GGP = (QND, CHR)
LMR = (KFM, LMM)
HHQ = (KHG, VCF)
XVN = (TGH, FQM)
QTS = (DRH, XDN)
JPM = (JHQ, FGM)
LSB = (HKB, SPH)
NMQ = (BPF, VCP)
QKC = (SKL, RMD)
SXB = (LFG, MQV)
MRM = (SFR, NRD)
GSG = (LFR, TST)
MRR = (CFK, FXG)
RFS = (DDK, LML)
PTL = (MGN, JMV)
NXF = (PPK, MLT)
KSN = (MCK, HGN)
SFR = (NSN, DDP)
RHB = (KDQ, HQD)
SBM = (LGD, HKJ)
BCN = (BJH, DQC)
KTJ = (QBQ, PPC)
NMD = (RHB, GCD)
DFB = (PNP, HVJ)
GHG = (TGH, FQM)
LGC = (RQQ, KFQ)
NTS = (KJK, SMK)
BFM = (JLB, SFN)
HHK = (NFR, XDR)
PCN = (KKC, TQG)
XJV = (LLB, FXJ)
PPC = (NNK, KQC)
DTB = (RFH, FKB)
QNM = (RQJ, RXM)
HGN = (FJJ, HKQ)
PHJ = (HRH, LCF)
CMR = (VQK, TBM)
SXL = (TVV, TCP)
HPT = (XLR, HGK)
XVX = (PPP, QHF)
XRC = (PCC, SFT)
QXB = (HRR, SHN)
JMV = (RKL, RMN)
RTN = (MRN, STL)
JDD = (LDQ, QPB)
JTB = (HHJ, MGG)
MLM = (TVM, NBF)
BJP = (XTT, XTT)
HQN = (TXT, NJF)
XGV = (KHB, PPS)
XDB = (BHQ, XXC)
QVC = (GNB, CSV)
SFT = (LRD, XXR)
MXB = (MCR, DJK)
NQV = (CVM, PBV)
JQM = (TCP, TVV)
LFG = (BDT, RMH)
SMK = (LMT, PCR)
BXJ = (QMR, TVP)
LDD = (RQX, NGP)
RDX = (DFD, DSX)
KNQ = (BNF, QNS)
JLN = (MBF, XLS)
QFM = (CDD, GCT)
RND = (RTR, QPQ)
FLC = (BJN, NBR)
RRC = (CPK, DDC)
RVD = (DCC, NSC)
KQF = (TDG, HPN)
MPN = (MDC, FDF)
HKQ = (XDM, VCC)
PPK = (BTF, NQV)
QHS = (PRQ, MLJ)
HGK = (RXC, HBL)
DNX = (GMG, TBB)
HVJ = (HCD, DXG)
NHX = (RCF, RQF)
KHB = (PQN, PHV)
LNV = (VJF, BKH)
QMT = (XDJ, LQV)
VJK = (TXB, SJF)
PJH = (HLH, GVJ)
QNS = (MPN, BDP)
TVP = (RLR, MQN)
GBR = (HGG, TJG)
BRM = (LXV, FRK)
JFS = (FXG, CFK)
TKR = (TFD, CDS)
NBR = (KNX, NXQ)
KMJ = (PDS, FGF)
LKK = (NBR, BJN)
KPD = (MBK, TTT)
FVH = (FLL, XPM)
DSF = (JNP, HCM)
FCD = (HTC, XSK)
RNP = (MHH, HQS)
XBB = (SQB, SNM)
SDS = (GNX, BBP)
KBP = (XXT, KXJ)
FDF = (GSV, KGV)
CKP = (MSV, TTX)
MST = (QND, CHR)
RMH = (KNP, SQC)
JJQ = (MFN, VKS)
BXF = (RQT, JGF)
TCP = (JBV, QKC)
LTR = (BJP, BJP)
MNT = (XLR, HGK)
NXX = (NMF, MRM)
KFF = (TDG, HPN)
NCC = (THG, MVT)
KGV = (PKP, RMP)
HVH = (NJG, BND)
RKL = (STN, GTF)
CTH = (TST, LFR)
FQF = (NNC, XBB)
LFR = (GTM, FCD)
SLD = (HNM, MQQ)
TTJ = (FFR, FFR)
DQJ = (MNJ, LSB)
RQF = (XRC, FNX)
XHR = (GGJ, KTJ)
HJP = (CCD, JXG)
CTC = (QVL, KSN)
GQM = (TJM, HHN)
TGT = (MCP, MDH)
PBK = (MBK, TTT)
JGF = (MQX, BXJ)
FLL = (NVD, FKG)
TGH = (VVC, LVF)
MQN = (NKD, JNC)
SVX = (XCM, PPX)
MCP = (HVH, SVN)
FSN = (NXL, SGG)
TQG = (GXX, LDD)
HBA = (QCG, KMM)
DMK = (VCF, KHG)
QKD = (FXF, QFG)
MDH = (SVN, HVH)
QTM = (XCM, PPX)
PMP = (HGG, TJG)
JXS = (TSM, LDX)
LDQ = (NXT, DDV)
KNX = (BPX, RND)
KNP = (HKV, CDT)
XCM = (MPQ, HKC)
KMM = (VXM, XSH)
FFR = (QBS, QBS)
PLN = (GRH, QXB)
JFF = (QTS, SSQ)
FVK = (NBM, JCB)
TQN = (DKD, HHV)
HGX = (MSR, GVB)
CSD = (HHK, BFQ)
CNJ = (SLH, NXX)
THD = (XXC, BHQ)
TNL = (XGH, XKN)
MHH = (GGP, MST)
KQD = (DNK, QGR)
TSD = (VHK, QRH)
DSB = (BGV, NFK)
CPN = (TPG, LPH)
KBV = (LPH, TPG)
DTS = (PQR, BXX)
PPX = (MPQ, HKC)
LLP = (LVH, CJH)
PLL = (SJF, TXB)
CVS = (VLG, FGC)
HHJ = (CSD, DQV)
QFQ = (BTT, VBP)
FVP = (PPK, MLT)
TFV = (QBV, GQG)
NPK = (KNQ, RPV)
DVQ = (RNV, FPF)
DSX = (DGJ, RQB)
PBV = (CMP, JSH)
SQX = (JBN, RPD)
VJC = (SBD, HRK)
RLR = (NKD, JNC)
FTN = (MFN, VKS)
TRB = (RRC, SHR)
LVH = (XDB, THD)
NXB = (CMR, VDB)
JSM = (HQJ, GTD)
HHH = (XXF, JJB)
RPD = (JDD, RPL)
XSF = (QXB, GRH)
XPM = (FKG, NVD)
BNR = (CCT, NXD)
HKN = (KXJ, XXT)
KCP = (FFR, XVB)
PHB = (QFM, PPD)
DLC = (PMP, GBR)
GMG = (FKD, LKP)
DQC = (HQP, MLM)
SMM = (SXL, JQM)
SBP = (JRG, XHR)
GCR = (FPF, RNV)
FNX = (PCC, SFT)
PQB = (NKM, CMF)
TJM = (NXB, NPP)
PPS = (PQN, PHV)
BDP = (FDF, MDC)
CXN = (XPM, FLL)
VDB = (TBM, VQK)
SBD = (TDP, JBM)
NXQ = (RND, BPX)
DRH = (HXN, SKC)
VBG = (BCS, GSN)
LSJ = (GNX, BBP)
VCP = (KMQ, RMC)
MVL = (VMG, SCG)
JCB = (TPD, CVS)
MGG = (DQV, CSD)
RXS = (JTT, RNJ)
BTF = (PBV, CVM)
DFD = (DGJ, RQB)
GGJ = (PPC, QBQ)
BPK = (VBT, KQD)
DKD = (CNN, HSD)
SQD = (PHJ, CSL)
PQG = (JFM, PJH)
RMN = (STN, GTF)
RCV = (HRK, SBD)
MBK = (GKQ, MJS)
CXR = (SDS, LSJ)
XSK = (PLV, TQN)
FBR = (BFM, GQH)
GCD = (KDQ, HQD)
PMF = (FGM, JHQ)
XLP = (RFT, BMN)
NSC = (QFQ, QJL)
SHR = (CPK, DDC)
DXL = (TQG, KKC)
TTH = (XTT, TKZ)
CGS = (KSN, QVL)
QHF = (HGX, JJT)
NFR = (XPS, RDX)
CHR = (BBK, FLR)
RPL = (LDQ, QPB)
GTD = (MRJ, KJH)
PNP = (HCD, DXG)
GCT = (QKV, SQX)
SGG = (CRV, PQB)
HNN = (BVB, NMD)
HLK = (CLM, DDL)
GSN = (VDJ, HNN)
KFB = (JRQ, DSF)
XXR = (FNS, VDV)
FJJ = (XDM, VCC)
TCJ = (HJP, XSP)
DJK = (RTL, LSC)
NJF = (FKL, BNB)
BGV = (JSD, GQM)
JSH = (VTG, XVX)
JBV = (RMD, SKL)
RNV = (KBV, CPN)
FKB = (KMJ, DKH)
CDT = (HVC, DTS)
TQT = (TPR, VSF)
FNG = (LKK, FLC)
RBJ = (GFB, FBF)
RTR = (KFB, VHB)
BKH = (SGJ, DCM)
JRG = (GGJ, KTJ)
GTF = (TVC, QHQ)
JXG = (KQF, KFF)
MBF = (GXS, NQR)
GNB = (FLF, MTB)
KFK = (FMH, DLS)
LBT = (GQG, QBV)
CGT = (VSF, TPR)
GVA = (CTG, VQH)
FNP = (GLL, TPP)
RQT = (BXJ, MQX)
CDV = (BPK, FXM)
JCX = (QVX, LKM)
XSH = (SXB, JVV)
HKV = (DTS, HVC)
MRN = (HRB, LMR)
SBX = (CHT, SQD)
FRP = (CTG, VQH)
HHN = (NPP, NXB)
NGG = (SJL, SJL)
BJB = (KRL, JNR)
GNX = (LTR, LTR)
RCR = (KBH, NCC)
NDN = (MQM, JFF)
VXT = (JGF, RQT)
PPG = (BBG, THJ)
CDS = (TSD, HVZ)
VSJ = (LGC, CTR)
NSN = (DNF, TMT)
VRJ = (GBR, PMP)
CDQ = (VLF, SBP)
XDN = (HXN, SKC)
LCF = (FTM, CDQ)
HCQ = (DCF, RTN)
BPF = (KMQ, KMQ)
NNC = (SQB, SNM)
LQV = (SHQ, FTC)
VFH = (NRT, NRT)
VHK = (TMN, FNG)
LPH = (BMT, NHX)
PPD = (GCT, CDD)
BXH = (VTD, XTD)
LMT = (TLL, DSB)
TSM = (TKH, BHK)
KMQ = (NCS, NCS)
FTV = (RXM, RQJ)
XGJ = (MFQ, DPG)
RXM = (TSJ, HQG)
QBV = (SSH, QTB)
TBM = (HHR, FVK)
CCR = (MRR, JFS)
SKL = (GHG, XVN)
HRK = (JBM, TDP)
MFQ = (PQG, PDF)
DNK = (QJX, BGP)
BDL = (GMG, TBB)
MQQ = (HKN, KBP)
RQR = (THJ, BBG)
KFM = (GKN, DFN)
XKN = (HTL, PVS)
PDF = (JFM, PJH)
TTT = (GKQ, MJS)
RHG = (SFQ, XMX)
XTD = (NGG, NRM)
LXV = (SBT, HCQ)
HCD = (NPK, SBC)
TFT = (RFT, BMN)
DDK = (MCS, DFR)
DFR = (SBX, TRH)
BND = (GHM, BDJ)
SFN = (GXB, HND)
HQD = (QKD, XRD)
RMC = (NCS, LLZ)
RQQ = (PBK, KPD)
LKP = (PVK, SBM)
PQR = (SHC, NDN)
DGJ = (TKT, XXV)
CHF = (QCG, KMM)
SCG = (BDL, DNX)
TJG = (HHH, KJG)
PDV = (FVP, NXF)
HGG = (KJG, HHH)
VHB = (JRQ, DSF)
KBH = (THG, MVT)
PVD = (BRM, LSV)
MNJ = (HKB, SPH)
CJH = (THD, XDB)
DCF = (STL, MRN)
XLS = (GXS, NQR)
SBC = (RPV, KNQ)
BTH = (LDX, TSM)
CPV = (JXS, BTH)
DGR = (XLP, TFT)
NFK = (GQM, JSD)
VBP = (THN, BDB)
RTL = (HQN, XQT)
SJL = (FRP, FRP)
XPC = (QFM, PPD)
FXM = (VBT, KQD)
MCK = (FJJ, HKQ)
KRM = (DPD, JTB)
BNF = (MPN, BDP)
SQB = (MHV, FSN)
QKV = (JBN, RPD)
QBQ = (KQC, NNK)
FPF = (CPN, KBV)
SPH = (XBH, RXS)
PLV = (HHV, DKD)
DQV = (BFQ, HHK)
NJQ = (LHV, TQC)
PXH = (LKM, QVX)
TMN = (FLC, LKK)
LVF = (FBR, GTB)
BCS = (VDJ, HNN)
HHR = (JCB, NBM)
HHD = (NXD, CCT)
FGF = (QHS, NPB)
LSC = (XQT, HQN)
HQJ = (MRJ, KJH)
CHT = (PHJ, CSL)
HLH = (DGR, LTS)
NRD = (DDP, NSN)
JBN = (JDD, RPL)
TRT = (KBH, NCC)
HHV = (HSD, CNN)
DDL = (QCT, KLR)
CSV = (MTB, FLF)
SLH = (NMF, MRM)
THJ = (VLR, RNP)
CTG = (VJC, RCV)
MLL = (HVT, TDH)
HLV = (BPF, BPF)
XJS = (DQC, BJH)
RMD = (GHG, XVN)
BGP = (GCR, DVQ)
RCF = (FNX, XRC)
GHM = (XBL, CPV)
DLS = (HPT, MNT)
BDB = (BJB, QHM)
SVN = (BND, NJG)
NSV = (HVJ, PNP)
VQC = (GNB, CSV)
BHR = (PPG, RQR)
CCD = (KFF, KQF)
SBB = (TBJ, HLK)
VVC = (FBR, GTB)
SHQ = (VFH, TPL)
VMF = (MNJ, LSB)
MSV = (XPN, VSJ)
TDH = (JJQ, FTN)
RXC = (DQJ, VMF)
RSP = (MQQ, HNM)
SSH = (GLF, RVD)
LTS = (TFT, XLP)
HTC = (PLV, TQN)
GLF = (NSC, DCC)
BTT = (THN, BDB)
DFN = (RPC, CPJ)
NKM = (QMT, FJT)
RMP = (LLP, GHD)
PRQ = (DLC, VRJ)
TBJ = (CLM, DDL)
CPJ = (FSM, FQF)
LHD = (GSN, BCS)
GLL = (RBJ, RBJ)
TXT = (FKL, BNB)
NCS = (VHR, HCS)
GLQ = (JFN, TNL)
BMT = (RCF, RQF)
JRQ = (HCM, JNP)
FXJ = (VXT, BXF)
GMR = (LBT, TFV)
NMH = (XJS, BCN)
RQX = (JSJ, JSJ)
VXM = (JVV, SXB)
PCH = (SLH, NXX)
TXV = (XGJ, RGP)
XNB = (FKB, RFH)
JPS = (FTV, QNM)
JSJ = (TFD, TFD)
LLZ = (HCS, VHR)
HPN = (QTM, SVX)
DPG = (PQG, PDF)
NKD = (CTC, CGS)
TKZ = (BHR, BGC)
HRB = (KFM, LMM)
TLL = (NFK, BGV)
MPQ = (KDN, DSR)
BVB = (RHB, GCD)
JFN = (XKN, XGH)
QTB = (RVD, GLF)
BFQ = (NFR, XDR)
LCT = (SDS, LSJ)
SQL = (BCN, XJS)
LML = (MCS, DFR)
NMF = (SFR, NRD)
CPK = (BXH, QXK)
JHQ = (RFS, BQS)
QRH = (FNG, TMN)
MLT = (NQV, BTF)
BJH = (HQP, MLM)
XHC = (TBJ, HLK)
VQK = (FVK, HHR)
NXD = (LJB, NTS)
FSM = (NNC, XBB)
KHG = (GTC, RPG)
RTX = (BKH, VJF)
HSD = (PXH, JCX)
PND = (JTB, DPD)
CRV = (NKM, CMF)
FMH = (HPT, MNT)
BPX = (QPQ, RTR)
THN = (BJB, QHM)
XBH = (JTT, RNJ)
GVJ = (LTS, DGR)
KRL = (DFB, NSV)
XPS = (DFD, DSX)
TST = (GTM, FCD)
GKQ = (PDV, NQK)
HKC = (KDN, DSR)
DQH = (VBR, JLN)
GJF = (JFN, TNL)
QBS = (CHF, CHF)
HTL = (NXP, LGP)
MCS = (TRH, SBX)
RKR = (BRM, LSV)
VBR = (MBF, XLS)
FKD = (SBM, PVK)
FXF = (TVX, TCJ)
FBF = (KRM, PND)
QJL = (BTT, VBP)
QJX = (GCR, DVQ)
NGC = (FMH, DLS)
TPG = (BMT, NHX)
GTM = (HTC, XSK)
CTR = (KFQ, RQQ)
NQR = (HHD, BNR)
XGH = (PVS, HTL)
LKM = (VJK, PLL)
SHN = (JPM, PMF)
LMM = (DFN, GKN)
DDV = (SBB, XHC)
GQG = (QTB, SSH)
DDP = (DNF, TMT)
CSL = (HRH, LCF)
LLB = (VXT, BXF)
NPP = (VDB, CMR)
HKJ = (RHG, PNM)
QVL = (HGN, MCK)
TVV = (JBV, QKC)
MVT = (SXP, PTL)
VBT = (DNK, QGR)
XRD = (QFG, FXF)
GTB = (BFM, GQH)
JNP = (XPC, PHB)
KTC = (MDH, MCP)
QVX = (PLL, VJK)
QFN = (TRB, NVQ)
VLR = (HQS, MHH)
BDT = (SQC, KNP)
JCP = (TDH, HVT)
KKC = (GXX, LDD)
BDJ = (CPV, XBL)
GRH = (SHN, HRR)
GXB = (RBC, BTC)
MNF = (CHF, JLZ)
FGM = (RFS, BQS)
RVJ = (SXL, JQM)
FXG = (NGC, KFK)
HND = (RBC, BTC)
NXT = (XHC, SBB)
FKG = (KTC, TGT)
MQX = (QMR, TVP)
JJT = (GVB, MSR)
MHV = (SGG, NXL)
KJG = (JJB, XXF)
SBT = (DCF, RTN)
TPR = (QFN, HTG)
BNB = (XGV, MRQ)
XXT = (VBG, LHD)
PKP = (LLP, GHD)
HCS = (GLQ, GJF)
TKT = (XSF, PLN)
HRR = (PMF, JPM)
BHQ = (CGT, TQT)
FKL = (XGV, MRQ)
HRH = (FTM, CDQ)
QPB = (NXT, DDV)
XDJ = (SHQ, FTC)
PTT = (GTD, HQJ)
MDC = (KGV, GSV)
KXJ = (VBG, LHD)
FLF = (NJQ, MFB)
FTM = (VLF, SBP)
QCT = (FFV, MXB)
HTG = (TRB, NVQ)
TKH = (JCP, MLL)
XXC = (CGT, TQT)
MFN = (TTJ, KCP)
HQS = (MST, GGP)
GKN = (CPJ, RPC)
RQB = (XXV, TKT)
VKS = (TTJ, KCP)
QMR = (RLR, MQN)
XTT = (BGC, BHR)
MRJ = (JKQ, CCR)
SKC = (SMM, RVJ)
PVS = (LGP, NXP)
GXS = (BNR, HHD)
GVB = (GSG, CTH)
FQM = (LVF, VVC)
CMP = (XVX, VTG)
NVA = (VHK, QRH)
CCT = (NTS, LJB)
KJZ = (VQH, CTG)
STN = (TVC, QHQ)
HQP = (TVM, NBF)
DDC = (BXH, QXK)
QGR = (QJX, BGP)
GHD = (CJH, LVH)
MTB = (MFB, NJQ)
SSQ = (DRH, XDN)
QND = (FLR, BBK)
LGP = (CNJ, PCH)
RPG = (JSM, PTT)
XXF = (CDH, TXV)
XDM = (SRV, GMR)
VLG = (JPG, VJM)
NJG = (BDJ, GHM)
VCF = (GTC, RPG)
DSR = (QBJ, JPS)
DNF = (SLD, RSP)
MSR = (GSG, CTH)
BBG = (VLR, RNP)
XXV = (PLN, XSF)
MLJ = (VRJ, DLC)
MFB = (LHV, TQC)
QPQ = (KFB, VHB)
DCM = (CDV, BCH)
NRM = (SJL, VDX)
JNC = (CTC, CGS)
XQT = (TXT, NJF)
FLR = (NMH, SQL)
BQS = (DDK, LML)
BTC = (FVH, CXN)
QHM = (KRL, JNR)
RFT = (HLV, NMQ)
KLR = (FFV, MXB)
SHC = (MQM, JFF)
LNK = (VMG, SCG)
QCG = (VXM, XSH)
VMG = (DNX, BDL)

View File

@@ -0,0 +1,15 @@
LR
mmA = (mmb, xxx)
mmb = (xxx, mmZ)
mmZ = (mmb, xxx)
nnA = (nnb, xxx)
nnb = (nnc, nnc)
nnc = (nnZ, nnZ)
nnZ = (nnb, nnb)
ooA = (ooZ, oob)
oob = (ood, ooc)
ooc = (ooA, oox)
ood = (ooZ, ood)
ooZ = (oob, ooZ)
xxx = (xxx, xxx)

732
resources/2023/day8lucy.txt Normal file
View File

@@ -0,0 +1,732 @@
LLLLLLLRRRLRRRLRLRLRLRRLLRRRLRLLRRRLLRRLRRLRRLRLRRLRLRRRLRRLRLRRRLRRLRRLRLRRLLRLLRLRRRLRRLRLLLLRRLLLLRLRLRLRRRLRLRLLLRLRRRLRRRLRRRLRLRRLRRRLRLLLRLLRRLRRRLRRLRRLRRLRLRRRLRLRLRLLRRRLRRRLRRLRRRLLLRRLRRLRRRLRLRRRLRRRLRLRRLRRRLRLRRLRLRRLRRRLRLRRLRLLRRRLLRLRRLRRRLLLRLRRLRRRR
DGK = (KVQ, XHR)
KTC = (TVB, MTH)
CGR = (VVK, BKP)
LCG = (FQC, KHX)
PSZ = (FSF, QSM)
FBJ = (FHP, SPX)
KJD = (NRQ, VDH)
NCM = (JPJ, KNG)
TXH = (HNK, VHQ)
NND = (TRC, DFM)
JQN = (CNX, XLD)
RHB = (CDG, GBT)
JBN = (PXV, GVN)
DFC = (JRN, TXH)
TXG = (CHT, VBL)
XXQ = (JDC, JGV)
SVF = (FVD, LHQ)
FVK = (LCG, RNB)
XKT = (MPF, XJJ)
MHB = (JSJ, VQM)
FVC = (HXF, VVN)
JJR = (VNS, SLM)
RMT = (GDS, XHP)
CHT = (PXS, VLF)
SFJ = (XGC, LPM)
BJL = (XDN, VXN)
PQK = (NHS, DVB)
PDB = (JPQ, TVJ)
RGL = (DNN, NCN)
KRN = (SBL, PHL)
MTF = (PJL, KQR)
BTL = (CCF, LDP)
NLV = (CPM, HVL)
GCQ = (QMF, JVH)
KVH = (VKD, PQG)
RLB = (GSS, JVP)
QRB = (TNL, DKN)
JFV = (RDR, NSB)
BFC = (LGH, XLX)
HGQ = (SLM, VNS)
FQC = (VFQ, BXC)
DDS = (XHR, KVQ)
VQV = (SFT, BFQ)
XFD = (HVV, FLH)
TVP = (XQF, KSS)
GBH = (NPX, LDB)
KHL = (MGS, MMD)
NPX = (BJL, SFF)
VMG = (DHX, GVC)
RTJ = (XRF, BPK)
TLM = (NCG, QBB)
LXS = (TVB, MTH)
XNM = (QFL, KQK)
KQR = (QRD, JBN)
JQD = (DNN, NCN)
QCF = (MXL, MXL)
QMH = (NKG, SDJ)
NKK = (MCB, RLB)
MPJ = (BTL, JTF)
TLS = (VPJ, LMD)
XJB = (LML, TKZ)
HGF = (HBF, QHB)
KNJ = (QKM, XLR)
XCF = (QCJ, HTN)
HFS = (NKC, JFV)
QLS = (QBB, NCG)
QFL = (NXQ, QBN)
MTH = (FLN, LQR)
VND = (KMM, MQH)
NQQ = (VVH, NDL)
BTV = (QSM, FSF)
SLT = (NRQ, VDH)
NKG = (TBV, XCV)
SLM = (LBN, HPK)
CMQ = (KKS, VBH)
JTF = (LDP, CCF)
VFC = (GKH, KPS)
KCC = (JVM, MTF)
KFP = (MVX, NMX)
NQF = (QSK, KCC)
GGC = (VBV, TJR)
QQS = (NKK, NQC)
LXK = (FXC, QBC)
DVQ = (TFF, LKB)
PBL = (BGQ, FHQ)
KHV = (BVJ, XSD)
LDB = (SFF, BJL)
RJG = (LJB, CJM)
RCX = (QTB, PPL)
FLH = (HSX, KVX)
XTV = (HST, VCC)
GDC = (CMH, NCT)
RDP = (FKR, GHJ)
NXM = (PVV, KRX)
SCQ = (MFN, GRB)
MRT = (XGT, VLK)
DHJ = (XHP, GDS)
XFL = (TJK, QMH)
XQF = (CCQ, RPH)
CLV = (CKD, CCD)
CMT = (NCD, XDM)
NCT = (SXG, CLF)
JSS = (GMJ, LJC)
TLQ = (CRC, DXQ)
DMJ = (HHB, DRV)
JBH = (FVC, HDX)
QXK = (QSB, JBH)
DQN = (QMD, GDN)
SDH = (PRH, BCX)
QSB = (HDX, FVC)
MTP = (VVG, SPN)
CTM = (MFG, GGJ)
HND = (MNV, TXG)
MJS = (DMJ, QQG)
JNL = (LKB, TFF)
QLL = (FKM, HNH)
PNM = (PQR, NRL)
VSF = (LPM, XGC)
QBC = (QQS, MVF)
BFM = (FBP, BQJ)
KNG = (RTJ, CXN)
VFQ = (HFS, LBS)
LKB = (QVB, TXF)
KQD = (CDJ, CDJ)
ZZZ = (DHJ, RMT)
XKX = (HVP, NJF)
GSL = (QMS, DHM)
PNT = (CDJ, GJZ)
KBN = (CMQ, JBG)
DNX = (SFM, GFJ)
NMX = (XRR, LKL)
VPJ = (PSK, GQL)
XQD = (QCF, QCF)
HRM = (RHB, XXJ)
LCL = (MRT, FMB)
DRG = (RNB, LCG)
BKP = (QLL, MMQ)
FSF = (SLR, XGV)
KHX = (BXC, VFQ)
SXG = (NHL, KGK)
MJD = (TDH, RFP)
NRL = (CSG, MPT)
FBP = (QGC, GXH)
HDT = (LHQ, FVD)
BMP = (RMG, JXM)
NCN = (SLT, KJD)
NXQ = (JPP, QQL)
NGV = (HNJ, VVQ)
NPN = (MXL, NJK)
FVD = (XBQ, NKF)
GQM = (QCG, GGC)
QBP = (XML, HND)
VQT = (BTL, JTF)
HKP = (CMH, NCT)
JHP = (NDL, VVH)
FRL = (SHD, FNH)
FLN = (NVL, HGF)
MXH = (QSD, KKR)
BGL = (XCX, RFC)
RSQ = (MKH, TLS)
VML = (RJM, CXK)
XHP = (MJS, DNP)
GRV = (XRN, TVQ)
GKH = (BCF, VSD)
SPH = (MVX, NMX)
TLD = (LFR, GFQ)
LML = (QKS, NND)
PKT = (VXC, CMF)
LLQ = (THT, GRV)
CKD = (SPB, QDV)
KRM = (JQV, JNG)
RNS = (HJJ, MLV)
FKR = (FKK, BHN)
XNH = (SCQ, KLF)
GDN = (LBL, FHT)
CRB = (NHQ, QRB)
JKQ = (DPT, KBN)
NJF = (RJG, NGF)
NRT = (NSK, CSL)
LJR = (VTT, HCQ)
HLK = (DFC, DPV)
PQR = (MPT, CSG)
DNF = (NJF, HVP)
MPV = (HJD, XSF)
TBV = (XTJ, SVH)
LKX = (XFJ, HBM)
KTP = (CGR, RVR)
HVL = (BJH, QXK)
GJD = (XJJ, MPF)
HLC = (VVQ, HNJ)
JTX = (NCD, XDM)
CSG = (MFF, RKT)
PCH = (PGJ, GQM)
SFF = (VXN, XDN)
TCF = (KNG, JPJ)
LDP = (XFD, SBS)
XCR = (GJD, XKT)
QBM = (GFB, LRH)
CLP = (RJM, CXK)
MTT = (HST, VCC)
TQL = (BPM, GGT)
LFR = (HNF, RDP)
JHN = (CMT, JTX)
XCX = (CHG, CHG)
XGT = (HLK, QJF)
TQS = (TKL, MNF)
KFL = (HGQ, JJR)
LHQ = (XBQ, NKF)
CCQ = (DBP, HHC)
TKL = (VDN, PBP)
LBX = (BXM, SDH)
XLX = (NGJ, LHJ)
GVN = (BPG, TNK)
CCX = (HCQ, VTT)
KQK = (QBN, NXQ)
NQC = (MCB, RLB)
MPF = (DFT, SBG)
BNH = (MLV, HJJ)
CJM = (LBH, TNM)
CND = (VKB, PGQ)
HXM = (GMJ, LJC)
TKZ = (NND, QKS)
RKT = (LNQ, KFL)
GXH = (RQP, LBX)
TFF = (QVB, TXF)
LNK = (FDC, MXH)
KPK = (BNH, RNS)
QQG = (HHB, DRV)
MFP = (PQK, NBF)
VVK = (QLL, MMQ)
GFB = (RHN, LCN)
PPD = (QCJ, HTN)
FXV = (BPM, GGT)
KSS = (CCQ, RPH)
KCM = (LTB, PCH)
RHN = (FXV, TQL)
LFV = (DDJ, NQF)
JKG = (BGQ, FHQ)
MBS = (RQJ, LDQ)
HHC = (NGV, HLC)
CCD = (QDV, SPB)
RFM = (FTB, HSB)
QCG = (VBV, TJR)
GRH = (LXK, LGQ)
CDJ = (QQJ, BFC)
THT = (TVQ, XRN)
QRD = (PXV, GVN)
VHQ = (SXV, GJL)
MLV = (VRM, MCP)
XRR = (CLV, PBJ)
NMS = (DGK, DDS)
JPS = (JKT, KHL)
DJJ = (QMS, DHM)
MFG = (TLQ, VQD)
GPQ = (SHL, BNR)
QVB = (GDC, HKP)
LNN = (CMF, VXC)
VBQ = (LNN, PKT)
MMS = (SVV, HRM)
BGJ = (HXM, JSS)
QCK = (JSJ, VQM)
PKB = (XNH, JQH)
BCF = (TQR, TLL)
JRN = (VHQ, HNK)
SHL = (DMK, JBX)
LRG = (NSK, CSL)
NJV = (FJH, TXC)
GHQ = (FSB, HFX)
LHN = (TLS, MKH)
HBF = (BMP, GLM)
DTP = (DVQ, JNL)
FXR = (FTB, HSB)
PDS = (XLD, CNX)
SXV = (CPC, JNF)
QMF = (GGF, JDP)
JVP = (GPC, DNX)
RMG = (HRF, PKB)
LRH = (LCN, RHN)
HVP = (RJG, NGF)
TRC = (VKX, RQL)
PJL = (QRD, JBN)
HNK = (GJL, SXV)
CHM = (NBF, PQK)
PGH = (KMM, MQH)
SDN = (MFP, CHM)
DMK = (VRP, NNX)
MRR = (NGK, SMQ)
QDV = (NDM, JPT)
PGJ = (QCG, GGC)
BVJ = (NLV, HBR)
PGQ = (BGK, GBH)
LKL = (CLV, PBJ)
FDC = (KKR, QSD)
JDP = (PDB, PTX)
NJJ = (HSJ, GRH)
TVJ = (HDT, SVF)
NJK = (RBV, ZZZ)
HHN = (DPP, TLD)
QMS = (BLS, TQS)
QVR = (CVB, BNJ)
FFQ = (RMJ, HGZ)
LGQ = (QBC, FXC)
JPP = (RSG, KTG)
DPV = (TXH, JRN)
HBR = (CPM, HVL)
NSK = (JQN, PDS)
SBS = (HVV, FLH)
BFQ = (VBQ, JPB)
LBN = (LXJ, CCR)
RBD = (KRM, PNX)
NQX = (LML, LML)
XSA = (QKS, NND)
NDB = (HFX, FSB)
QMD = (LBL, FHT)
XTJ = (JDT, JDT)
GLH = (SHL, BNR)
FXC = (MVF, QQS)
HSX = (NFN, LVG)
JNF = (JJH, FNR)
CXK = (SPC, TVP)
GGF = (PDB, PTX)
XBQ = (QNX, JCQ)
LJC = (SFJ, VSF)
MMD = (XLK, CND)
HFG = (JKT, KHL)
NHQ = (TNL, DKN)
JVM = (KQR, PJL)
CGH = (RTC, VFC)
HNF = (GHJ, FKR)
TMF = (NMS, GJH)
NGJ = (NXM, BDB)
MRM = (JKQ, MPS)
QTC = (JSS, HXM)
TNM = (JFF, QXR)
DHK = (LJR, CCX)
XSB = (MRR, CXC)
XRN = (XDP, QBP)
XCV = (XTJ, SVH)
VVA = (QSM, FSF)
NKC = (RDR, NSB)
MXL = (RBV, RBV)
PTX = (TVJ, JPQ)
VRL = (NQX, XJB)
RQK = (MPS, JKQ)
PBJ = (CKD, CCD)
VRP = (DQN, QLC)
KLF = (MFN, GRB)
XXJ = (GBT, CDG)
HST = (QHV, MMS)
SFT = (JPB, VBQ)
NRR = (LCL, MQR)
CSL = (JQN, PDS)
LHJ = (BDB, NXM)
TXK = (DHK, KLC)
CDK = (XCX, XCX)
FHT = (NGQ, JHN)
QQJ = (LGH, XLX)
BQJ = (GXH, QGC)
TTA = (QKM, XLR)
TVB = (FLN, LQR)
PPL = (FRL, NCX)
SPS = (XFJ, HBM)
SVH = (JDT, VRL)
QBB = (PXG, MTP)
JSJ = (VVB, NRR)
KKS = (RGL, JQD)
JDT = (NQX, NQX)
GKQ = (LLT, JRH)
VVH = (BPT, KRN)
JCQ = (CRB, PBS)
QXR = (BTV, PSZ)
VQR = (RCX, KKP)
QSM = (SLR, XGV)
JKD = (JDC, JGV)
XLD = (LFS, QVR)
TJK = (NKG, SDJ)
PVV = (HDK, VQV)
BDB = (PVV, KRX)
MPS = (KBN, DPT)
FHP = (PPD, XCF)
HTN = (KCM, PXC)
GHJ = (BHN, FKK)
JCC = (LQM, KVH)
LQR = (HGF, NVL)
LGM = (DDJ, NQF)
NJN = (QCF, NPN)
PRH = (DFF, DFF)
XDM = (FBJ, PJM)
HFN = (KRS, XSB)
GLM = (JXM, RMG)
RQP = (BXM, SDH)
BPG = (QJT, KTP)
JPB = (LNN, PKT)
DKN = (CJD, BGR)
CDG = (GSL, DJJ)
XDN = (CGM, VMG)
NQP = (SKT, JCC)
DNP = (QQG, DMJ)
NNX = (DQN, QLC)
FTB = (JFL, VJJ)
FHQ = (SMJ, XFK)
GGT = (KPK, LNT)
NGF = (LJB, CJM)
QFX = (KCN, TMF)
NKF = (JCQ, QNX)
DBP = (NGV, HLC)
RBV = (RMT, DHJ)
NML = (MBV, VCG)
KXJ = (MXH, FDC)
GFQ = (RDP, HNF)
SHD = (CMG, CTM)
GTX = (LNK, KXJ)
HXF = (KTC, LXS)
CMM = (NQP, SBR)
SDJ = (TBV, XCV)
CHG = (RMJ, RMJ)
DPT = (CMQ, JBG)
BGR = (RLM, NML)
THM = (XQD, NJN)
HJJ = (MCP, VRM)
NRQ = (JHR, GCQ)
KKR = (HSN, NJJ)
KVX = (LVG, NFN)
LTT = (TLD, DPP)
NVL = (QHB, HBF)
CXN = (XRF, BPK)
KLC = (CCX, LJR)
JDC = (DNF, XKX)
MGS = (XLK, CND)
RLM = (VCG, MBV)
VDN = (NMQ, TPR)
HSB = (JFL, VJJ)
HDS = (KLC, DHK)
XSD = (NLV, HBR)
HJD = (NJQ, PBQ)
CGM = (DHX, GVC)
LDQ = (PBL, JKG)
RDR = (XHQ, MGQ)
GPC = (GFJ, SFM)
NQT = (KRS, XSB)
TDH = (RBD, XLP)
QJF = (DFC, DPV)
VNS = (HPK, LBN)
QSD = (NJJ, HSN)
JHR = (QMF, JVH)
SMQ = (FXR, RFM)
CMG = (MFG, GGJ)
NKQ = (VFC, RTC)
VXC = (LHN, RSQ)
DHX = (LCT, XNM)
TCX = (NQT, HFN)
DRV = (TFN, QBM)
JPT = (GQX, XCR)
HRF = (JQH, XNH)
MCS = (BGJ, QTC)
PQG = (NCM, TCF)
XHR = (PJK, VPN)
MLX = (PGH, VND)
MKH = (VPJ, LMD)
TJR = (VQT, MPJ)
VLF = (GLG, QFX)
JNG = (KLR, MPV)
HDK = (BFQ, SFT)
HFX = (MLX, SPL)
BXC = (HFS, LBS)
CCT = (GTX, HPT)
VLK = (HLK, QJF)
NCD = (PJM, FBJ)
VGT = (JNL, DVQ)
LMD = (PSK, GQL)
KRX = (HDK, VQV)
QNX = (CRB, PBS)
NJQ = (GHQ, NDB)
TNV = (FBP, BQJ)
GNR = (XQD, NJN)
KKP = (QTB, PPL)
DBX = (KCQ, CPS)
VRM = (TLM, QLS)
LVG = (BRP, NJV)
NHL = (SPS, LKX)
MNV = (VBL, CHT)
PJK = (HHN, LTT)
VBH = (JQD, RGL)
GRB = (NKQ, CGH)
SKT = (KVH, LQM)
TPR = (RXR, KHV)
VVB = (LCL, MQR)
VKX = (MRM, RQK)
LTB = (PGJ, GQM)
QCJ = (KCM, PXC)
BGQ = (SMJ, SMJ)
RCV = (NQQ, JHP)
DHM = (TQS, BLS)
KRS = (CXC, MRR)
JFL = (BLT, PNM)
TXC = (NRT, LRG)
MVX = (LKL, XRR)
QSK = (JVM, MTF)
BGK = (LDB, NPX)
GJZ = (BFC, QQJ)
PXC = (LTB, PCH)
HMQ = (BGJ, QTC)
RXR = (BVJ, XSD)
BXM = (PRH, BCX)
FJH = (LRG, NRT)
GJH = (DGK, DDS)
BPT = (SBL, PHL)
RQL = (RQK, MRM)
SJB = (RQJ, LDQ)
NFN = (NJV, BRP)
MND = (NQQ, JHP)
NMQ = (KHV, RXR)
XGV = (TXK, HDS)
SPC = (KSS, XQF)
RMJ = (SMR, QRS)
CNX = (LFS, QVR)
KLR = (HJD, XSF)
XLP = (KRM, PNX)
LPM = (CMM, PHF)
FNR = (CCT, VTP)
NGQ = (CMT, JTX)
CCR = (BFM, TNV)
LCN = (FXV, TQL)
HVV = (HSX, KVX)
FSB = (MLX, SPL)
GGJ = (TLQ, VQD)
NHS = (DRG, FVK)
RQJ = (PBL, JKG)
VCC = (MMS, QHV)
HDX = (VVN, HXF)
VQM = (NRR, VVB)
TFN = (GFB, LRH)
QRS = (VQR, MDS)
HBM = (VTQ, SDN)
CCF = (SBS, XFD)
VCG = (HMQ, MCS)
NBF = (DVB, NHS)
DVB = (FVK, DRG)
PGB = (TDH, RFP)
XRF = (KFP, SPH)
KMM = (PDJ, GQN)
KTG = (GGQ, HNR)
BJH = (JBH, QSB)
JJH = (CCT, VTP)
LBH = (JFF, JFF)
GLG = (TMF, KCN)
TQR = (THM, GNR)
MQH = (GQN, PDJ)
MQR = (FMB, MRT)
FNH = (CTM, CMG)
SMR = (VQR, MDS)
GDS = (DNP, MJS)
LCT = (KQK, QFL)
VKB = (GBH, BGK)
VTQ = (CHM, MFP)
TNK = (QJT, KTP)
HNJ = (VVS, GCX)
JKT = (MMD, MGS)
PBP = (TPR, NMQ)
CPS = (KNJ, RFZ)
RNB = (KHX, FQC)
CMF = (LHN, RSQ)
HPK = (CCR, LXJ)
MFN = (NKQ, CGH)
HHB = (QBM, TFN)
DDJ = (QSK, KCC)
DFM = (RQL, VKX)
FKM = (GKQ, VJG)
HSJ = (LGQ, LXK)
HPT = (KXJ, LNK)
BNR = (JBX, DMK)
GJL = (CPC, JNF)
DFF = (KCQ, KCQ)
MCB = (GSS, JVP)
CPC = (JJH, FNR)
XLR = (MJK, DSM)
SBG = (JDG, XFL)
XSF = (NJQ, PBQ)
NGK = (RFM, FXR)
HSN = (GRH, HSJ)
LQM = (PQG, VKD)
VXN = (VMG, CGM)
PSK = (VGT, DTP)
JQH = (KLF, SCQ)
RJM = (SPC, TVP)
VSD = (TLL, TQR)
KCN = (GJH, NMS)
QHB = (GLM, BMP)
FMB = (VLK, XGT)
GBT = (DJJ, GSL)
LGH = (NGJ, LHJ)
SLR = (HDS, TXK)
VVQ = (GCX, VVS)
MDS = (RCX, KKP)
KVQ = (VPN, PJK)
CLF = (NHL, KGK)
XFK = (KQD, PNT)
CJD = (NML, RLM)
MCP = (TLM, QLS)
SPL = (PGH, VND)
GSS = (GPC, DNX)
RPH = (DBP, HHC)
HNR = (XXQ, JKD)
VBV = (VQT, MPJ)
PHF = (NQP, SBR)
BRP = (FJH, TXC)
AAA = (RMT, DHJ)
PBQ = (GHQ, NDB)
PXG = (VVG, SPN)
PNX = (JQV, JNG)
XHQ = (SJB, MBS)
VBL = (VLF, PXS)
VVG = (MTT, XTV)
PXS = (GLG, QFX)
MMQ = (FKM, HNH)
PHG = (HFN, NQT)
MFF = (KFL, LNQ)
PJM = (FHP, SPX)
SMJ = (KQD, KQD)
XGC = (CMM, PHF)
PDJ = (QCK, MHB)
SPN = (MTT, XTV)
BPK = (KFP, SPH)
MVF = (NQC, NKK)
LJB = (LBH, LBH)
GQN = (QCK, MHB)
NCG = (MTP, PXG)
GQL = (VGT, DTP)
NCX = (FNH, SHD)
HGZ = (QRS, SMR)
GMJ = (VSF, SFJ)
RFP = (XLP, RBD)
TXF = (GDC, HKP)
NBA = (SMR, QRS)
QTB = (FRL, NCX)
QLC = (GDN, QMD)
QHV = (SVV, HRM)
XTM = (GRV, THT)
VPN = (HHN, LTT)
RFZ = (XLR, QKM)
CMH = (SXG, CLF)
GFJ = (TCX, PHG)
VTT = (LGM, LFV)
RTC = (GKH, KPS)
XFJ = (VTQ, SDN)
GCX = (PGB, MJD)
MJK = (CLP, VML)
QQL = (RSG, KTG)
NSB = (XHQ, MGQ)
HCQ = (LGM, LFV)
GQX = (GJD, XKT)
RVR = (VVK, BKP)
JBG = (KKS, VBH)
JFF = (BTV, BTV)
BPM = (LNT, KPK)
LNQ = (JJR, HGQ)
FKK = (GLH, GPQ)
SBL = (CDK, BGL)
LNT = (BNH, RNS)
JRH = (JPS, HFG)
VVS = (MJD, PGB)
DPP = (LFR, GFQ)
MNF = (PBP, VDN)
QKM = (DSM, MJK)
JPJ = (CXN, RTJ)
QGC = (RQP, LBX)
CVB = (MND, RCV)
RFC = (CHG, FFQ)
KPS = (BCF, VSD)
XML = (MNV, TXG)
JVH = (JDP, GGF)
CRC = (XTM, LLQ)
VJG = (JRH, LLT)
SPB = (JPT, NDM)
JGV = (XKX, DNF)
GGQ = (XXQ, JKD)
XLK = (PGQ, VKB)
JBX = (NNX, VRP)
RSG = (HNR, GGQ)
GVC = (LCT, XNM)
XDP = (XML, HND)
CXC = (SMQ, NGK)
PXV = (TNK, BPG)
NDM = (XCR, GQX)
CPM = (BJH, QXK)
KGK = (LKX, SPS)
BLT = (NRL, PQR)
BHN = (GLH, GPQ)
BLS = (TKL, MNF)
PHL = (CDK, BGL)
BCX = (DFF, DBX)
HNH = (GKQ, VJG)
VKD = (NCM, TCF)
DSM = (VML, CLP)
DNN = (SLT, KJD)
SBR = (SKT, JCC)
TNL = (BGR, CJD)
DFT = (XFL, JDG)
MPT = (RKT, MFF)
TVQ = (XDP, QBP)
LLT = (JPS, HFG)
DXQ = (XTM, LLQ)
SFM = (PHG, TCX)
BNJ = (MND, RCV)
PBS = (NHQ, QRB)
JXM = (HRF, PKB)
VTP = (HPT, GTX)
SVV = (XXJ, RHB)
MHA = (QQJ, BFC)
MBV = (HMQ, MCS)
VJJ = (BLT, PNM)
QJT = (RVR, CGR)
VVN = (LXS, KTC)
QKS = (TRC, DFM)
MGQ = (MBS, SJB)
NDL = (BPT, KRN)
JPQ = (SVF, HDT)
VDH = (JHR, GCQ)
KCQ = (KNJ, KNJ)
XJJ = (DFT, SBG)
JQV = (MPV, KLR)
VQD = (DXQ, CRC)
JDG = (TJK, QMH)
SPX = (XCF, PPD)
LXJ = (TNV, BFM)
LBL = (NGQ, JHN)
QBN = (QQL, JPP)
LFS = (CVB, BNJ)
LBS = (JFV, NKC)
TLL = (THM, GNR)

View File

@@ -0,0 +1,8 @@
LLLR
AAA = (AAA, BBB)
BBB = (BBB, CCC)
CCC = (CCC, ZZZ)
ZZZ = (AAA, AFM)

View File

@@ -0,0 +1,20 @@
LR
11A = (11B, XXX)
11B = (XXX, 11Z)
11Z = (11B, XXX)
22A = (22B, XXX)
22B = (22C, 22C)
22C = (22Z, 22Z)
22Z = (22B, 22B)
XXX = (XXX, XXX)
33A = (33Z, XXX)
33Z = (XXX, 33A)
44A = (44B, XXX)
44B = (XXX, 44C)
44C = (44Z, XXX)
44Z = (XXX, 44C)
55A = (55B, XXX)
55B = (XXX, 55Z)
55Z = (55C, XXX)
55C = (XXX, 55Z)

200
resources/2023/day9.txt Normal file
View File

@@ -0,0 +1,200 @@
28 38 58 115 255 558 1167 2343 4564 8699 16328 30378 56447 105549 199601 381868 735876 1418100 2712150 5115341 9472583
24 34 56 103 191 343 593 990 1602 2520 3862 5777 8449 12101 16999 23456 31836 42558 56100 73003 93875
12 30 66 118 187 291 486 901 1807 3760 7885 16402 33536 67001 130303 246169 451478 804146 1392500 2347766 3860393
11 7 -1 -10 4 101 392 1052 2337 4631 8595 15584 28661 54781 109041 222274 453659 910327 1775963 3349730 6094694
13 26 56 110 200 360 677 1347 2785 5847 12267 25493 52275 105732 211455 420013 833076 1658291 3323777 6713131 13636877
24 36 50 68 92 124 166 220 288 372 474 596 740 908 1102 1324 1576 1860 2178 2532 2924
4 10 18 35 81 207 523 1232 2664 5299 9766 16819 27345 42607 65306 103013 177906 352348 792280 1916515 4732055
2 4 15 46 115 246 479 915 1841 4022 9326 21995 51143 115539 252570 534754 1099830 2205374 4328183 8346246 15873877
6 16 41 104 240 508 1016 1959 3670 6684 11815 20246 33632 54216 84958 129677 193206 281560 402117 563812 777344
10 24 59 127 240 410 649 969 1382 1900 2535 3299 4204 5262 6485 7885 9474 11264 13267 15495 17960
1 3 19 65 161 334 621 1072 1753 2749 4167 6139 8825 12416 17137 23250 31057 40903 53179 68325 86833
1 3 14 46 118 256 493 869 1431 2233 3336 4808 6724 9166 12223 15991 20573 26079 32626 40338 49346
5 20 54 111 200 339 551 863 1338 2203 4189 9270 22068 52271 118490 254073 515553 994838 1837662 3275301 5689494
11 19 37 74 152 315 630 1176 2019 3189 4728 6991 11599 23863 58350 151043 385257 945993 2232085 5082986 11226568
-6 -5 -1 6 16 29 45 64 86 111 139 170 204 241 281 324 370 419 471 526 584
19 44 79 123 175 234 299 369 443 520 599 679 759 838 915 989 1059 1124 1183 1235 1279
20 26 41 76 144 261 459 824 1572 3189 6707 14297 30581 65483 140200 299218 633600 1324592 2722729 5487182 10824554
2 13 49 134 316 686 1400 2714 5060 9211 16601 29879 53781 96407 171038 298877 513930 873445 1482345 2550372 4520094
7 22 55 116 218 381 645 1090 1862 3209 5540 9533 16335 27918 47680 81409 138761 235440 396309 659706 1083288
23 34 43 54 73 105 151 202 234 223 220 555 2284 8074 23894 62315 149406 340397 757350 1681105 3771572
-2 9 31 72 157 346 769 1701 3724 8065 17266 36441 75513 153008 302220 580858 1085650 1973817 3493849 6028622 10154597
17 35 83 175 326 554 878 1305 1800 2233 2292 1349 -1702 -8485 -20570 -37084 -47977 -18173 145725 659887 1980386
6 19 49 119 273 598 1257 2530 4856 8858 15310 24963 38082 53479 66865 68818 44405 -18660 -94790 -14282 809438
17 21 22 20 15 7 -4 -18 -35 -55 -78 -104 -133 -165 -200 -238 -279 -323 -370 -420 -473
8 23 59 139 312 672 1383 2710 5056 9005 15371 25253 40096 61758 92583 135480 194008 272467 375995 510671 683624
9 16 34 63 103 154 216 289 373 468 574 691 819 958 1108 1269 1441 1624 1818 2023 2239
8 19 59 140 275 481 794 1315 2308 4381 8817 18206 37692 77458 157694 318613 640892 1287715 2591041 5226414 10560561
8 21 37 57 82 107 117 88 -4 -163 -339 -377 54 1555 5117 12270 25264 47285 82709 137397 219034
22 34 44 52 58 62 64 64 62 58 52 44 34 22 8 -8 -26 -46 -68 -92 -118
28 57 114 220 416 779 1446 2651 4785 8494 14832 25483 43057 71450 116238 185052 287858 437047 647230 934638 1316054
16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96
28 39 48 62 97 180 347 630 1022 1413 1518 905 -557 -1064 7553 50137 189888 570667 1494764 3559032 7883557
5 0 3 30 106 262 542 1035 1947 3728 7269 14184 27192 50614 91000 157901 264801 430224 679031 1043922 1567158
4 21 55 119 239 461 864 1591 2913 5356 9967 18894 36631 72557 145803 294037 588486 1158435 2229571 4181885 7634411
8 11 15 33 81 182 384 805 1728 3777 8206 17321 35023 67400 123199 213865 352632 551879 817609 1139457 1474069
6 15 30 69 162 358 754 1560 3223 6658 13679 27799 55705 109973 214073 411584 783020 1476065 2758724 5110417 9373988
18 26 37 54 84 138 231 382 614 954 1433 2086 2952 4074 5499 7278 9466 12122 15309 19094 23548
3 -2 -7 -12 -17 -22 -27 -32 -37 -42 -47 -52 -57 -62 -67 -72 -77 -82 -87 -92 -97
16 32 61 121 242 466 847 1451 2356 3652 5441 7837 10966 14966 19987 26191 33752 42856 53701 66497 81466
13 35 79 160 302 554 1015 1865 3399 6061 10475 17470 28096 43628 65555 95551 135425 187047 252247 332684 429682
13 6 -9 -20 11 156 538 1364 2981 5967 11279 20495 36207 62647 106658 179157 297277 487420 789503 1262734 1993315
14 11 18 51 141 348 790 1714 3660 7803 16602 34939 71995 144184 279550 524126 950858 1671811 2854498 4743307 7687145
2 7 22 56 123 242 437 737 1176 1793 2632 3742 5177 6996 9263 12047 15422 19467 24266 29908 36487
19 34 68 128 220 349 519 733 993 1300 1654 2054 2498 2983 3505 4059 4639 5238 5848 6460 7064
21 48 85 132 195 292 468 836 1684 3739 8772 20876 48964 111327 243473 510946 1029407 1994954 3728471 6738732 11810049
11 27 55 108 210 394 696 1143 1733 2405 2997 3190 2436 -132 -5810 -16455 -34641 -63841 -108637 -174960 -270362
12 12 12 25 90 292 791 1869 4012 8064 15537 29266 54829 103647 199701 393835 793523 1623291 3344337 6885726 14081159
5 13 31 72 164 358 736 1410 2499 4070 6039 8076 9700 11088 15835 38309 120943 371965 1044017 2693426 6497234
-1 -4 4 46 162 411 867 1607 2698 4206 6273 9338 14615 24985 46510 90835 178809 345728 648682 1176574 2063472
8 16 23 40 92 216 455 847 1408 2108 2839 3374 3316 2036 -1401 -8323 -20552 -40520 -71401 -117260 -183220
27 54 93 143 215 340 581 1059 2009 3892 7603 14833 28665 54510 101519 184641 327535 566586 956321 1576571 2541779
18 25 37 63 114 201 333 515 746 1017 1309 1591 1818 1929 1845 1467 674 -679 -2763 -5777 -9950
11 23 58 131 266 508 956 1834 3618 7240 14408 28142 53779 101035 188408 352630 668776 1292502 2547568 5104551 10339633
20 30 55 112 230 464 919 1792 3444 6514 12092 22012 39486 70717 129039 244932 488666 1018738 2181538 4711697 10130222
8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 113 120 127 134 141 148
8 17 18 5 -32 -110 -256 -510 -928 -1585 -2578 -4029 -6088 -8936 -12788 -17896 -24552 -33091 -43894 -57391 -74064
0 6 28 73 155 304 573 1043 1826 3066 4938 7645 11413 16484 23107 31527 41972 54638 69672 87153 107071
8 14 26 39 49 61 112 320 974 2687 6657 15139 32341 66134 131237 254984 487637 921079 1723959 3210704 5981290
-3 6 32 88 209 468 1005 2092 4276 8669 17497 35106 69812 137381 267702 517614 995199 1904592 3626038 6854228 12829699
16 14 18 32 52 64 53 40 180 979 3722 11247 29252 68383 147421 297965 571096 1046604 1845466 3146378 5207268
0 19 60 146 330 708 1432 2721 4864 8205 13096 19800 28322 38142 47820 54439 52848 34663 -13020 -109250 -281238
19 37 70 119 185 269 372 495 639 805 994 1207 1445 1709 2000 2319 2667 3045 3454 3895 4369
8 18 30 51 92 174 350 764 1787 4310 10347 24225 54843 119816 252855 516572 1024178 1975442 3715028 6825207 12270294
9 31 64 108 163 229 306 394 493 603 724 856 999 1153 1318 1494 1681 1879 2088 2308 2539
27 36 46 65 110 223 504 1178 2725 6116 13214 27417 54640 104755 193632 345950 598975 1007532 1650430 2638633 4125506
-3 -9 -19 -25 -9 63 252 660 1449 2882 5441 10155 19412 38768 80661 171586 365345 766697 1572457 3141343 6110353
9 13 16 19 30 81 256 730 1819 4041 8188 15409 27304 46029 74412 116080 175597 258613 372024 524143 724882
8 17 26 35 44 53 62 71 80 89 98 107 116 125 134 143 152 161 170 179 188
13 29 69 150 300 564 1014 1770 3055 5340 9688 18482 36824 75023 152753 305660 595433 1124631 2057879 3651414 6293380
19 39 64 101 169 299 534 929 1551 2479 3804 5629 8069 11251 15314 20409 26699 34359 43576 54549 67489
26 48 79 119 168 226 293 369 454 548 651 763 884 1014 1153 1301 1458 1624 1799 1983 2176
16 28 45 62 80 120 240 563 1330 3003 6482 13603 28310 59352 126262 272164 590489 1279633 2753130 5858989 12311553
16 27 38 49 60 71 82 93 104 115 126 137 148 159 170 181 192 203 214 225 236
16 26 52 107 212 412 806 1601 3204 6384 12578 24502 47411 91748 178785 352718 706597 1437520 2962583 6158201 12843931
15 23 44 100 234 527 1138 2396 4995 10379 21457 43857 88008 172421 328611 608145 1092295 1904695 3227218 5318970 8537806
19 35 67 125 219 359 555 817 1155 1579 2099 2725 3467 4335 5339 6489 7795 9267 10915 12749 14779
14 9 -2 -25 -60 -96 -107 -38 250 1146 3714 10678 28555 72047 172745 395881 871826 1854119 3824278 7677249 15042442
0 14 48 119 263 559 1175 2446 5004 10002 19512 37235 69743 128583 233715 418934 740144 1287614 2203656 3707527 6129775
-6 -13 -11 9 54 127 233 409 798 1797 4331 10342 23629 51210 105348 206191 384454 682459 1149765 1826027 2697892
14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -1 -2 -3 -4 -5 -6
9 15 23 41 93 228 528 1127 2265 4422 8622 17094 34685 71869 151157 320706 682873 1452897 3076233 6455943 13379245
26 38 54 85 154 309 648 1354 2736 5284 9786 17637 31605 57512 107535 206117 399770 772302 1467138 2718337 4891512
7 2 -4 -11 -19 -28 -38 -49 -61 -74 -88 -103 -119 -136 -154 -173 -193 -214 -236 -259 -283
17 40 72 120 202 355 665 1340 2867 6327 14000 30508 64985 135242 275772 552897 1092529 2128842 4085140 7700052 14210216
-3 -4 -7 -12 -19 -28 -39 -52 -67 -84 -103 -124 -147 -172 -199 -228 -259 -292 -327 -364 -403
9 21 38 62 99 161 268 450 749 1221 1938 2990 4487 6561 9368 13090 17937 24149 31998 41790 53867
2 9 39 99 204 393 760 1519 3132 6545 13600 27720 54996 105835 197349 356668 625334 1064865 1763453 2843561 4469892
20 33 49 75 125 228 457 1004 2337 5480 12453 26893 54846 105671 192927 335020 555266 880875 1340177 1957191 2742379
18 21 16 6 5 57 270 860 2190 4774 9202 15936 24945 35235 44593 50493 54394 73951 171296 510662 1464845
10 11 18 38 71 100 71 -142 -790 -2316 -5409 -10945 -19511 -29701 -33227 -2480 138638 579164 1757487 4641596 11293649
25 33 43 67 138 323 742 1611 3346 6797 13731 27756 55976 111792 219447 421300 789851 1449309 2618271 4700169 8479106
27 42 62 88 120 169 286 615 1492 3635 8492 18826 39628 79522 153115 285551 522357 951296 1749478 3279940 6279276
-1 11 47 125 280 574 1106 2022 3525 5885 9449 14651 22022 32200 45940 64124 87771 118047 156275 203945 262724
13 21 51 115 225 393 631 951 1365 1885 2523 3291 4201 5265 6495 7903 9501 11301 13315 15555 18033
20 35 53 83 140 245 425 713 1148 1775 2645 3815 5348 7313 9785 12845 16580 21083 26453 32795 40220
10 26 63 132 248 429 694 1074 1663 2751 5098 10427 22235 47044 96239 188667 354200 638496 1109225 1864062 3040786
6 -1 -9 -15 -17 -13 13 141 635 2188 6391 16606 39556 88146 186315 377108 735668 1389501 2549183 4553679 7935653
9 15 43 117 265 514 885 1388 2017 2745 3519 4255 4833 5092 4825 3774 1625 -1997 -7533 -15495 -26471
7 22 41 65 106 207 489 1245 3117 7431 16845 36609 76972 157632 315649 618971 1188707 2234572 4109585 7392185 13006510
10 9 5 -1 3 51 224 700 1840 4321 9327 18809 35825 64971 112914 189038 306214 481705 738217 1105107 1619759
12 16 30 69 148 282 486 775 1164 1668 2302 3081 4020 5134 6438 7947 9676 11640 13854 16333 19092
1 0 10 42 98 172 270 462 979 2368 5718 12970 27324 53756 99658 175614 296325 481696 758098 1159818 1730710
8 19 38 73 142 283 562 1079 1973 3430 5708 9217 14739 23954 40566 72513 136014 262573 510546 983505 1858428
9 24 57 114 205 359 643 1184 2197 4026 7209 12582 21441 35785 58667 94684 150641 236428 366153 559578 843909
8 14 22 32 44 58 74 92 112 134 158 184 212 242 274 308 344 382 422 464 508
24 34 44 54 64 74 84 94 104 114 124 134 144 154 164 174 184 194 204 214 224
16 30 63 126 233 405 686 1187 2184 4316 8979 19130 40965 87415 185254 389023 807192 1649322 3307839 6494862 12463897
-7 -7 1 32 121 335 787 1666 3321 6479 12739 25563 52073 106047 212569 414805 783321 1428197 2513885 4276266 7040633
-2 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58
13 27 38 41 36 48 177 688 2156 5707 13455 29337 60698 121182 235783 449463 842011 1554867 2842648 5177133 9461476
15 42 93 182 326 549 884 1374 2086 3178 5119 9300 19562 45721 111199 268798 632393 1439844 3177921 6832092 14389654
7 28 73 151 265 408 559 679 707 556 109 -785 -2315 -4712 -8253 -13265 -20129 -29284 -41231 -56537 -75839
8 5 13 42 97 177 284 446 766 1532 3473 8340 20149 47680 109278 241921 518597 1082840 2220086 4508651 9140126
17 27 40 71 149 317 632 1165 2001 3239 4992 7387 10565 14681 19904 26417 34417 44115 55736 69519 85717
24 37 47 65 117 257 594 1347 2963 6367 13474 28217 58615 120994 248715 510261 1046343 2144574 4386122 8926186 18016274
11 16 36 80 158 277 445 706 1254 2711 6703 16929 40991 93338 199774 404089 777493 1431666 2536382 4342822 7213860
0 -2 8 48 141 321 657 1303 2580 5096 9915 18799 34571 61685 107144 181982 303624 499562 812938 1310810 2096097
4 15 39 91 211 473 995 1967 3741 7078 13740 27774 58093 123376 261026 543285 1106377 2204300 4310572 8314176 15899538
-7 6 36 87 163 272 446 788 1568 3411 7651 16966 36460 75419 150039 287505 531891 952452 1654990 2797097 4608209
13 29 56 95 152 244 405 692 1191 2023 3350 5381 8378 12662 18619 26706 37457 51489 69508 92315 120812
15 27 59 125 237 417 722 1283 2361 4428 8300 15415 28528 53504 103742 210470 445527 969865 2133765 4678765 10135083
20 31 57 122 274 596 1223 2377 4439 8101 14695 26909 50338 96812 191434 387177 794467 1639641 3377468 6902112 13932807
10 37 91 200 416 820 1528 2716 4696 8091 14175 25464 46666 86122 157896 284700 501870 862641 1445003 2360456 3765020
6 24 54 95 153 251 440 812 1516 2778 4926 8421 13895 22197 34448 52106 77042 111628 158838 222363 306741
9 24 49 84 125 162 193 281 693 2172 6405 16762 39393 84782 169869 320863 576881 994560 1653801 2664816 4176661
3 10 23 57 149 386 945 2142 4499 8866 16685 30566 55492 101260 187366 352765 675303 1309938 2562335 5026719 9836291
15 29 55 109 226 481 1024 2134 4299 8344 15672 28779 52397 95981 178896 340733 660899 1294259 2533505 4914517 9388784
14 33 78 166 331 644 1248 2423 4711 9165 17861 34963 68917 136884 273538 548338 1099300 2198986 4383250 8701159 17195603
7 5 5 7 11 17 25 35 47 61 77 95 115 137 161 187 215 245 277 311 347
0 2 9 21 38 60 87 119 156 198 245 297 354 416 483 555 632 714 801 893 990
8 11 29 79 200 478 1087 2365 4957 10076 19965 38689 73433 136495 248086 439830 758518 1269449 2059289 3241351 4974534
9 26 71 154 282 459 686 961 1279 1632 2009 2396 2776 3129 3432 3659 3781 3766 3579 3182 2534
-8 -9 -1 23 70 147 261 419 628 895 1227 1631 2114 2683 3345 4107 4976 5959 7063 8295 9662
14 38 88 183 349 621 1047 1694 2656 4064 6098 9001 13095 18799 26649 37320 51650 70666 95612 127979 169537
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61
10 17 33 71 156 319 593 1016 1655 2681 4550 8393 16823 35591 76964 166498 356232 749489 1545759 3118955 6149158
-2 5 20 55 147 378 896 1945 3924 7507 13868 25067 44665 78648 136752 234293 394618 652305 1057252 1679807 2617103
-2 -3 -3 12 76 250 640 1443 3044 6202 12405 24581 48599 96524 193673 393656 809674 1677915 3482413 7194006 14714566
-5 -2 2 11 40 131 388 1045 2594 6015 13162 27362 54272 103007 187497 327953 552225 896728 1406510 2133961 3135644
-1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21
6 23 51 90 140 201 273 356 450 555 671 798 936 1085 1245 1416 1598 1791 1995 2210 2436
22 44 78 135 237 421 758 1410 2772 5783 12540 27421 59046 123639 250801 493519 945638 1772306 3262446 5917591 10599023
24 37 60 106 197 375 727 1435 2867 5730 11311 21837 40990 74618 131688 225532 375442 608675 962934 1489396 2256363
12 20 49 112 222 392 635 964 1392 1932 2597 3400 4354 5472 6767 8252 9940 11844 13977 16352 18982
2 7 24 61 126 227 372 569 826 1151 1552 2037 2614 3291 4076 4977 6002 7159 8456 9901 11502
12 11 22 60 158 379 821 1618 2953 5122 8728 15159 27666 53731 110255 234858 510014 1112985 2415218 5172306 10872818
17 24 49 120 294 677 1456 2952 5715 10719 19792 36560 68444 130715 254454 501802 994701 1968430 3870295 7539464 14530122
25 40 65 122 253 535 1117 2293 4630 9184 17861 34010 63355 115342 204806 353380 588983 939636 1414390 1959381 2372399
25 52 90 138 195 260 332 410 493 580 670 762 855 948 1040 1130 1217 1300 1378 1450 1515
0 2 24 87 221 468 885 1547 2550 4014 6086 8943 12795 17888 24507 32979 43676 57018 73476 93575 117897
19 32 61 117 214 369 603 947 1457 2242 3509 5629 9228 15307 25395 41739 67535 107204 166717 253973 379234
23 32 38 44 60 103 197 373 669 1130 1808 2762 4058 5769 7975 10763 14227 18468 23594 29720 36968
4 11 19 35 76 180 439 1069 2539 5797 12662 26510 53500 104832 201057 380617 717363 1357502 2598934 5062820 10063437
10 19 23 14 -24 -121 -314 -610 -897 -761 888 6598 22021 59353 144459 331532 733040 1580211 3343069 6963206 14293206
3 17 48 105 201 354 600 1028 1847 3495 6800 13203 25053 45984 81384 138966 229451 367373 572016 868493 1288977
-4 -3 10 49 132 289 583 1147 2252 4449 8873 17855 36050 72341 142802 274973 513588 927669 1618516 2727541 4442064
19 39 74 133 236 422 765 1415 2696 5313 10758 22099 45557 93732 192181 392487 797276 1606233 3197558 6267150 12058959
-7 -10 -13 -16 -19 -22 -25 -28 -31 -34 -37 -40 -43 -46 -49 -52 -55 -58 -61 -64 -67
21 44 74 122 221 432 849 1603 2865 4848 7808 12044 17897 25748 36015 49149 65629 85956 110646 140222 175205
18 26 39 66 116 198 321 494 726 1026 1403 1866 2424 3086 3861 4758 5786 6954 8271 9746 11388
21 40 78 164 356 766 1605 3259 6420 12322 23187 43106 79841 148586 279840 535679 1042583 2055644 4079972 8092520 15934162
20 37 62 95 136 185 242 307 380 461 550 647 752 865 986 1115 1252 1397 1550 1711 1880
0 2 15 48 121 283 642 1407 2942 5832 10961 19602 33519 55081 87388 134409 201132 293726 419715 588164 809877
8 13 15 13 15 42 131 338 755 1592 3455 8105 20256 51423 127543 303162 686530 1482119 3060047 6065853 11589253
12 30 59 93 125 157 214 361 722 1498 2987 5640 10262 18599 34737 67942 137708 281702 566759 1101727 2048287
-3 10 49 127 264 492 863 1464 2440 4028 6633 11078 19417 37246 79490 183510 436575 1030078 2361565 5219525 11107638
16 33 54 90 174 378 846 1849 3867 7702 14625 26559 46299 77769 126315 199032 305122 456279 667096 955488 1343124
19 43 88 176 343 647 1194 2198 4111 7897 15598 31482 64323 131829 269087 544536 1090317 2160903 4249054 8320480 16296305
22 41 67 112 212 447 969 2039 4084 7808 14445 26357 48398 90840 175255 345646 688410 1366499 2675535 5132758 9613680
12 25 47 89 162 277 445 677 984 1377 1867 2465 3182 4029 5017 6157 7460 8937 10599 12457 14522
5 0 -7 -1 49 197 534 1225 2596 5304 10634 21018 41034 79540 154415 302881 602927 1215420 2462671 4968277 9895903
-9 -14 -15 1 65 237 627 1430 2974 5775 10594 18507 31038 50464 80459 127293 201992 324897 538038 942790 1811370
2 4 0 -10 -11 41 233 709 1684 3458 6430 11112 18143 28303 42527 61919 87766 121552 164972 219946 288633
7 26 67 150 317 656 1342 2714 5434 10819 21508 42739 84695 166680 324376 622208 1174037 2177180 3967333 7105608 12513901
12 22 38 64 119 247 532 1123 2276 4424 8309 15295 28210 53572 107038 225653 493336 1090494 2385292 5093646 10548309
14 12 10 19 59 159 357 700 1244 2054 3204 4777 6865 9569 12999 17274 22522 28880 36494 45519 56119
2 14 43 115 280 632 1341 2710 5286 10076 18959 35465 66244 123814 231609 433008 806986 1494370 2740499 4962479 8852304
16 36 82 165 307 556 1007 1841 3405 6374 12066 23034 44170 84820 163047 314653 612780 1210538 2432293 4964944 10250289
10 8 10 20 58 188 557 1451 3382 7223 14402 27147 48738 83665 137509 216252 324578 462546 619794 766166 837338
9 22 46 85 154 288 571 1200 2601 5616 11777 23672 45407 83249 146871 252546 431725 752582 1369644 2629419 5280540
16 20 35 87 210 449 878 1653 3133 6129 12402 25663 53593 111897 232285 477770 971150 1946550 3840269 7447123 14183748
22 44 94 197 405 821 1643 3250 6376 12465 24392 47913 94545 187207 371116 734593 1448530 2841203 5540681 10747619 20760527
4 15 42 101 226 487 1024 2115 4318 8768 17778 36006 72647 145461 288069 563007 1084756 2059673 3853830 7105719 12909204
15 23 48 115 271 611 1319 2724 5371 10107 18182 31365 52075 83527 129893 196478 289911 418351 591708 821879 1122999
7 6 17 48 107 202 341 532 783 1102 1497 1976 2547 3218 3997 4892 5911 7062 8353 9792 11387
-4 3 25 70 153 309 619 1270 2682 5750 12268 25628 51937 101824 193553 358902 655155 1190487 2177891 4048307 7684230
-2 4 19 40 65 112 264 766 2210 5847 14057 30979 63235 120551 215877 364424 581237 878545 1269600 1800115 2661524
18 30 45 58 64 58 35 -10 -82 -186 -327 -510 -740 -1022 -1361 -1762 -2230 -2770 -3387 -4086 -4872
8 20 59 143 292 523 844 1247 1700 2138 2453 2483 2000 697 -1826 -6077 -12688 -22432 -36241 -55225 -80692
11 12 8 -7 -28 -26 65 361 1041 2360 4662 8393 14114 22514 34423 50825 72871 101892 139412 187161 247088
6 6 19 54 113 189 264 307 272 96 -303 -1028 -2205 -3985 -6546 -10095 -14870 -21142 -29217 -39438 -52187
26 40 63 112 222 455 906 1708 3036 5116 8278 13187 21602 38439 76677 167925 383519 874229 1941697 4162964 8603981
12 19 31 58 110 209 412 843 1741 3551 7128 14215 28539 58216 120779 253209 531098 1103839 2256973 4519124 8840092
14 28 47 71 102 153 266 539 1162 2462 4957 9419 16946 29043 47712 75551 115862 172768 251339 357727 499310
19 22 38 89 208 457 958 1941 3833 7447 14380 27796 53861 104226 200137 378978 704206 1279303 2264473 3888958 6437241
20 38 83 177 353 665 1204 2120 3650 6152 10145 16355 25767 39683 59786 88210 127616 181274 253151 348005 471485
18 33 52 75 103 147 258 596 1573 4137 10313 24197 53757 114135 233848 466630 914030 1767831 3387708 6439669 12137157
16 32 61 98 136 164 171 173 281 836 2678 7743 20501 51456 125378 299753 704238 1621680 3648963 8007452 17127734
0 9 25 62 141 293 566 1037 1844 3286 6097 12096 25583 56164 124287 271914 582905 1221701 2506400 5046590 10003946
-4 12 56 141 280 486 772 1151 1636 2240 2976 3857 4896 6106 7500 9091 10892 12916 15176 17685 20456

View File

@@ -0,0 +1,3 @@
0 3 6 9 12 15
1 3 6 10 15 21
10 13 16 21 30 45

1000
resources/2024/day1.txt Normal file

File diff suppressed because it is too large Load Diff

1000
resources/2024/day2.txt Normal file

File diff suppressed because it is too large Load Diff

6
resources/2024/day3.txt Normal file
View File

@@ -0,0 +1,6 @@
<,:[*where()%mul(53,612)!^}&mul(3,518)??$~select()>??]mul(245,515),why()who()*@from()(where(242,190)mul(817,764)^select(),+who(851,301)where())from(){;mul(431,780)mul(110,982)what()what()]mul(441,829)??where()mul(269,112)>when()?who()<mul(131,147))}]what()^~)mul(186,137)when()'when(443,998)when()+-^what(770,821)?mul(742,949)>$**#!@mul(343,569),;what()from(){(;}mul(486,404)why()]#~when()%@do()+:'why(256,886)why()who(868,710)mul(103,406)?>mul(563,652)from()$-@when())!@:from()mul(744,992)[<^~}mul(822,789)],+select(45,52)!,why()<mul(609,728))who(879,937)&who(770,986):<-mul(723,41)<;select(366,476)why()(who()(%:'do()][@select()how(509,958)%^-<mul(402,767)]how()} #how();don't()how()mul(761,839)!%[#who()who()how()who(),-mul(769,131)>*mul(433,911) }why()<&&how()who()?]mul(877,899);':what())#{]@mul(401,705)@&<how()#mul(970,37)&# #+why()!how()mul(18,953)+what()mul(185,46)'/select()!{mul(474,848):>mul(627,54)? )~+mul(668,930)%)}do()what()#from()$/when()[:when() mul(545,444)how()]<how()^:?+-how()mul(470,601)how()~%from():how()mul(344,452)why()what(266,804)why()how(){who()do()mul(368,423)<#mul(662,80))+mul(7,851)mul(412,165)^,from()'*mul(653,405){}/,from()how()^#mul(592,415);}}>mul(409,150)>?%?@mul(295,205))'mul(321,875)mul(915,728){?when()what(644,532)*?;<<mul(61,812)#select()when()mul(101,342)<<!~why()mul(767,779)~#(^mul(176,413)}-]@>):(:mul(566,595)%'mul(499,468)/'where()}mul(721,340)]when()mul(162,291)mul(73,373)<]where()mul(100,385)][what()]mul(832,226)mul(675,546)who()how()#<^+how()'mul(119,723)what(){+,-mul(959,612)select()mul(758,905)!mul(247,521)&}$?don't()!'$ what()where(353,94)select(){mul(997,311)@from()/mul(987,583)&select(207,730)mul(299,379)select()do()what()select()when()select()]*?(?mul(841,179)!when()what()where()@:why()'>]mul(265,944)mul(968,747)what()}),(mul(541,36)~how()~select()where()when()-+when()mul(448,567)select()where()why(342,599) -when()<}mul(566,357)/$*>> mul(414,962)mul(904,116)what():/'@--}where()mul(390,663)who()~~],when()&where()[%mul(304,146))'who()>+when(){mul(526,627)!;(]@}where()where()mul(253,767)-^+]how()>,,!do():~[^when()]mul(263,450)mul(757,944)><'<mul(919,322)'mul(622,437)@mul(656who()[why()mul(998,113)<who()from()mul(103,114),from()where()/what()((select()'mul(961,712)$<when()select()[{}from(){when()mul(353,694)how()},what()mul(893,557)why()mul(137,971)<why()how()~&<,from()mul(925,982)]$+why()$why()]mul(721,960)[< ,&{when(293,949)select()@mul(788,237)%?+ > (],mul(934,282)@{who()+%when()mul(136,652)mul(366,573)!$//where()mul(501,845)}+~select()+]mul(532,462),~},from()mul(322,350)@~mul(64,374)&what()>[){mul(962,241),?/}-'+mul(39,522)%!$do()^}mul(447,40)mul(971,488)()mul(983,842)where()/mul(956,799);*+)^mul(233,820)mul(957,287)&>[when()<who()]%mul(48,993)# /:&when()]mul(164,671))?+~#;@mul(276,696)how()<+mul(557,793)?/select()mul(644,816)select(375,883)mul(10,640)?(~select()?!%,,'mul-;mul(976,164)*who()[mul(99,562)@why()!<:@mul(678,254)](/from()!]+%+mul(301,985)who()}[who()who()$mul(990,670)-<mul(187,242) mul(643,672)&?;mul(935,319);why()<[/](+((do()+]mul(137,423)*~ #!select(){mul(507,799)~:mul(351,147)
;mul(355; }~-&'mul(929,70)what()where()>why()where(855,333)<@)mul(304,558){~from(),how(){mul(555,718)]]-where() mul(881,781);^&);mul(231,766)$)mul(7,979)^why()'/,mul(352,951)mul(575,449)'mul(803/#(<^when()>mul(500,697)]~^<>[select();^when()mul(822,422)@[where()what() how()&;[(mul(756,744)how() @mul(741,854)what()(do()&how()){what()'^}-mul(664,580)<+ &+mul(788,961) -&}#!,how()who()mul(378,886)[!{,mul(53,236)what())select():~>why()~@who()mul(275,625)*from():what(80,711)why()@don't()mul(426,724)?&from()-)/^-mul(47,60)&+select()?%why()&where()mul(706,388)from()/how()mul(2,761)mul(377,995),from()*?{how()mul(198,840)why()&';[/+^~mul(72,849)mul(720,901 <(mul(998,859)mul(409,24)>?#-)why()mul(208,800)~how()+^?why()^mul(765,394) )mul(269,340)>mul:$~&select();mul(466,453)why()mul(59what()-?'where()?;who()mul(474,555)<[]]when()%-how(225,412)mul(626,574)/,{{what(832,679)where()how()mul(250,300)<#$;+mul(840,193)who(562,102),mul(390,251)(mul(6,397%~what();%who()from()#![mul(95,829)where(811,818)@mul(847,742)'~+&~@/mul(329,961)>~mul(625,917)#+what()<!+why()(how();mul(608,813)}(}how()!when()&+(mul(103,676)>%?>mul(314{mul(392,487)mul(770,684)]'mul(607,73)]where()/#what(378,688) :}'why(778,249)mul(732,423)from()$;@why()>mul(255,618),#+from(849,914);>mul(99,409):]mul(948,905)select()<@mul(342,35)$!@how()/)where():mul(49,617)mul(396,154)>mul(671,367)mul(68,795)~select()<:select()~/mul(900,855){ why(622,665)#when()-<@mul(629~{;~+how(){'mul(907,182)}<;+{' mul(223,519)}+>mul(776,473):where()what()^when()don't()/^ -/(/mul(894,814)mul(698,226)}<mul(188,843)when()mul(933,889)do()}~&%+,:>~/mul(570,960),?@?what()select()}/mul(918,543)'[from()&why()where())~from()[mul(321,507)mul(616,831)why()when()/]{mul#>[!!; mul(480,401)'%%~](from()mul(643,85)who()where()mul(982,510)when():,(mul(799,43[from())$what()%where()@;)mul(420,538)how()mul(358,891)who()what()what()select()(?how()*)mul(612,717)<+(where();who()from(170,645)how()why()where(310,422)mul(789,673)<what(139,371)mul(653,849)(mul(694,267){$(^ !mul(235,885)*>mul(779,49)what()who()[from()$*'&mul(211,472)why()< mul(77,895)?&:*-;^mul(861,148)/what()[+#}when(360,356)mul(905,744):~<-how()][-where()^mul(272,757select()'mul(994,335) what(362,794)$;$mul(242,327)who()when()who();don't()$mul(808,996);don't()/}from()(what()who()mul(398,570)from()~select()[mul(420,441)+mul(452,212)who();~what()#how()what()mul(557when(699,863)mul(184,806)&')from(),:'';don't()[select()mul(139,882~^(how()&mul(931,970)</what()^mul(123,183)select()/^where()when()+#mul(78,494)mul(77,46how(526,601),what(173,89)don't()mul(17,636)why()what()(?do()?what()+when(){;how()why(881,708):mul(424,30)]+mul(137,11)how()where()mul(436,135)from();* %how()-+<mul(682,942+from() from()+where()<%~mul(496,756)^when()-/;</mul(221,864),@,when()mul(451,731)<:why()(mul%<why()from()?~mul(578,746) ]]}!}#mul(392,317)why()](from(685,426)mul(742@:!<mul(348,805))$^mul(157,336)who()$$[{$,)#mul(104,791)what()mul(366,291)?@select()'{from()*mul(528,408)when();'$ ^[:mul(599,79):*;;,from()how(849,837) mul(450,261):<}why() ]@#mul(391,298)<;@why()@,'+,~mul(292,347)mul(306,66) (mul(918,583) @{~from(907,861)'~ ]what()mul(688,890)]what()~ who()when()&?< mul(664,167)>>]] &do()&*)(,:;,mul(924,272)who()$$%select()?/[mul(712,215)~,<from()*?mul(387,653)&mul(915,277)!where(){mul(896,316)what()$mul(60,641)why()mul(190,493)?*{why()+?-mul(516,394)
how()from()*^+from()from()where()}where()mul(109,757){;#mul(809,131)$from()where(43,487)mul(738,564):$*![mul(412#},,^mul(554,33)%why()-mul(617,108)why()mul(528,212)why()from()'!*mul(290,237)-mul(483,362)mul(326,290),who()#(%how()what(){[when()mul(135,76)mul(876,399)!}[^&~from()mul(827,264)%when()~&mul(347,10)mul(315,717)~'where()mul(650,381);,/mul(223,697)}%-*[$mul(296,607)@how()mul(766,686)-]:/when()what()mul(247,762)mul(840,623)$-]mul(879,79)]don't():where(838,375){:(%&when()mul(623,855)@++mul(401,488)!why()mul(713,679)! ?*;/^<%?mul(171,963){$$$~$[@)>mul(114,862) :select()#who()$&how():mul(617,150)]why()~(&@?mul(28,990)-)mul(221,546from()^:<&/[select()mul(5,78)mul(476,316)(<'%[mul(227,163)from()where()who()why()[ mul(229,680)>/+?how()<mul(969,755)!^why()how(965,419)mul(323,258)?>;select()&$[mul(110,33)~{)#who()]^+/mul(479%%#{#from()select()when()what()what()<mul(474,447)'where()mul(643,404)&*)@?('mul(768,724)@)?']>;)//mul(229,348)how()*/mul(643,351)mul(615,362(/->(how()-when()mul(499,697)*don't()mul(992,821){from(413,389));when()who()#mul(921,742)mul(253,580)]how()how(102,372) mul-from()where()mul(104,127)what(),{what() what()[*mul(657,659)'-select()mul(612,851)how()<~-when()$select(718,662)from()(!mulselect()-/^,<&^~mul(497,827)who()-how()-$select()+*mul(943,533)@;mul(403,629)why(826,610)} +:>mul(943,942)why():-)>^why()what()how()mul(302,757'mul(22,286):/-{mul(391,954)mul(528,734)select()-where()why() mul(909,426)!/($+mul(106#&-from()^mul(592,459)'(select()]!when()@{}*mul/&'>mul(894,472)who(),-#mul(924,264)%where()-{from()!mul(956,587)-$do()&why(173,205))$&~where()#&}mul(615,17)how(){>%from()from()@where()mul(683,358),how()when()<!@mul(32,94)!;why()mul(777from()+, :]}why()do()<'mul'>-}](;/mul(688,622)/select()}(what()mul(872,568)/why(){mul(600,562) #mul(733,946)( ?]/when()$(mul(606,986)@!when()mul(597,648)what()-who()from()?,>]<when()mul(18,911)/ how()@,]- {mul(267,646)}do()why()@!;why()mul(322,612),,;?(?^who()mul(34@*+[+^+<how()@#mul(946,367){^,mul(325,609)@#mul(496,574)?~)'*^~when()$'mul(493,377)+#~+>!'mul)>-&@~who()/%!mul(486,264)from())mul(556,968)(who()[:$:,*mul(564,519)# %)&/from(390,158)mul(583,746)how()why()('#/mul(519,835)&(/?^#,mul(447,762){?,]]]/@mul(257,451)&<$why()(mul(670,126){#:mul(555,660)}+%$:(select()mul(723,37)why()who()}where()}how()%)>don't()#where()how()]%what() select()mul(726,542)how()mul:how()/~}</>) mul(753,350)mul(905,645)+ how():(when(879,434)mul(632*?'$/,<*what()mul(442,98)$&(&;mul(424,515)!mul(443,813)**),^%how()what(),mul(252,469)select()[)mul(370,416)%&::&+%mul(885,78)how()^mul(885> {&,why()$mul(52,196)+,{%select(),!##;mul(714,770)mul(607,394)when()how() -@]mul+^@mul(90,350)~@+where()mul(934,150)when(788,941)^mul(557,327)mul(86,867) :~$-how()select()who()mul(166,855) what() %]mul(928,22)%when()-how()$!what():mul(628,252)~{>,who()~where(967,401)#mul(943,366)'[*>@mul(781,986)>:when()?&don't()~ :where()who()<what()who()mul(645,747)$,({$[mul(75,880),$?:when()what()[!when()mul(617,589)how()from()why()what()from()mul(63,146)'from()who()mul(530,247)!mul(747,431),(mul(920,122)mul(206,825)+when(414,126)>select():what()mul(839,261) *&*where())/]when()mul(24,536)how()how()'who()why())<,~mul(254,257)^@:where()mul(945,657)!&]select()from()}'[#)mul(148,151)-#!/usr/bin/perlwhere()>%why()}!/]{;mul(549,60)
how(477,669) mul(853,888)<[/who()>}+mul(361,751)mul(837,651)-mul(8,515)(}>!!# do()&@!:^][@mul(143,286)&?^&*how()&!'mul(88,781):}who(){!*!&mul(348,435)mulfrom()?>]-}+ }@mul(33,697)do()what()why()}(#]:mul(3,176):$mul(613,679),'how(882,581)who()*mul(519,798)from()mul(865,503),+~mul(767,837)/)?^why()/mul(520,288)where(){)who()what(); )mul(274,562)$:<^*what(423,612) from()>)mul(375,282)#select()from(646,967)?(*!'$mul(991,635)mul(598,876)%^?+mul(716,646)!)&mul(699,500){^^who()when()from()what()mul(314,198)%@;mul(419,800from()]$mul(844,419)$&]mul(317,754))<;^@(mul(222,12)##:what(751,642)$[from()%;mul(205,32)when()&{>+'>why()+mul(864,418)*@select()mul(911,629)*why();)^who()mul(248,4)}mul(132,503)/when()why()%mul(441,482)-mul(818,349)(#(where();(who(22,952)mul(534,621)$'~]where()why()-mul(199,973)mul(746,506)@'select()%{mul(866,951)from()mul(381,827)[select()*}(what()mul(744,979)mul(907,379)how(347,456)who()@what()##>;@mul(114,609),}what()'mul(406,863)][who()/when()mul(900,454)<'-)->[select()!select()mul(499,399)who()mul(349,409)',-~)select()mul(234,866)'why()mul(225,989)-(-mul(626,378);,$who()mul(597,85)mul(977,267)select(){mul(111,206):(&mul(989,396)#[:)<~{who()select()mul(689,817)mul(240,827)#how(){-+-@mul(663,156)'^$from())mul(416,908)*%why(714,896)#^+mul(993,707)'when()#;who()>where()select()?mul(978,206)@how(315,762)*/>why()({mul(998,362)who()$<(mul(488,946)},when()):}?where()where()}do()[!;?~{select()mul(673,574)%[::@;why()#]+mul(455,366)$~:mul(351,347)%,~-?what(595,890)]*select()mul(186,325)where()/:why(744,171)mul(513,868)/+why(118,201)mul(691,608) %mul(469,265)why()do()[mul(80,813)*<:mul(925,31):((mul(640,344)when(758,885)where()mul(474,482)?[>{where()]!mul(66,500)why()![# -mul(549,187,how()'where()*don't()#-<>%select()?who()]mul(581,943)?]what()}?) mul(54,791)]do()+$-)mul(255,793)who()]mul(338[)how()!@mul(253,351)++who()$mul(696,214)select()&mul(899%what()~}/what()-mul(302,687)when()#&mul(842,464)}?^$when()([()mul(579,190)<mul(432,910)^)mul(9,997)who()::what()from()mul(480,244)&)#mul(574)$@-]+$;mul(550,817)why()]<}[}who())]mul(129,159#$(?when()who()$^ mul(266,573)@mul(624,390)what();select()*from()mul(22,674$:]mul(675,762)(why(){://mul(493,757)*,$mul(624,120)?how()where()}mul(225,47):@)why()select(378,744)%& mul(867,37)~how()mul(91,26)$@]%){#select()*@mul(138,170)?*mul(531,483)-+<+)mul(714$who()select(569,250)}{)how()don't()?-when()when()-^%+^mul(475,925)why();!:from(){why()why()mul(231,576)'~@why()who(681,216)%(,/when()mul(393,115)^>@mulwho()where()~mul(238,298)from()<^(+,mul(766,436)how()^)%':{mul(427,646) ?%}(?<mul(476,338)from()why()&-[;'what()~mul(724,149~mul(25,405)mul(107,418){select()mul(107,999){why();]]mul(13,404)&^<@mulwhen()->mul(995,814)#~where()'}mul(267,274)']mul(174,583[,((!what()+when()*)mul(146,807)!:where()+!mul(856,39)?;@!mul(653,577)%}^do()^mul(961,701)::mul(23,391)<where()(from()~mul(915,472),& ?<select() when()mul(3,160),]select()?mulselect(),+from()]who()}]where(728,127)}:mul(742,873))mul(419,682)~/;#mul(330,468)[^?#*@~where()^/mul(352,725)>what()^*~-do()how()how(832,138);!}($#+mul(841,486)how()+# mul(255,21))-$who()when() -)> mul(427,236);&who(),where()+{mul(97,633)
::<where()mul(633,320)]([)what()why()^);'mul(695,733);<%how()-select()(;[mul(284,802)&?;when(372,205)mul(860,681),why()how()select(77,254)!;mul(284,605)?mul(312,805)when()how()#mul(256,855)-:#mul(252,605)who()mul(188,300)&-#<from()@where()^why()mul(696,379){how()~;when())mul(202,912)what()how()how(){](:-,mul(889,648),)[-when()!,mul(887,787)%;~{mul(559,711){&mul(664,834)#@where())+>where(946,25)!where()do()?where()-why()mul(129,728)>^&mul(557,253)mul(535,49)who()~$><?!mul(950,144)select(399,41)'':[when()mul(984,990)%/:select()~'^'@-don't() )mul(862,540)from()]who(964,165)don't()from()mul(378,581)[[from(295,573)~]/!)mul(29,139)mul(992,600))mul(560,53)>mul(342,811)([*don't(),+how(398,338)}why()<:mul(556,398)[@??:^(),how()mul(708,821):;-?</where()mul(160,2):when()select()mul(870,629))^]&when()^select(859,207)don't():{who()who(29,837)select()'}}who()~mul(392,813)'mul(145,581)mul(805,802)what()$]@+who()/do()#&how():select()])mul(472,752)>where()/when()select()%?how(955,77)why()mul(428,310)how()where()'mul(759,360)(#>;where()when()mul(396,975)}{mul(131,376)(!@what()%] @mul(100,818)mul(478,394)<%$<:%($&/mul(337,545)mul(227,220)who()-'+why()select()select()don't()why():';!mul(49,915)+))[do()?[when()mul(886,984)'^ who()>when()~mul(468,20)from()(<>why(){mul(791,347)? &} +mul(389,748)/[<;when()select()*mul(370,770)::[select();what()mul(63,701)why()^mul(361,364)when(592,110)select()+: ]mul(988,308)$mul(693{from()!(how()~/mul(782,22)why()mul(355,443)}<)%how()how(){[mul(47,507,^}>)&#don't()why()mul(459,418)?who()/(how()select()when(456,391)?select()mul(451(mul(473,946))who()how()*<how()+!@what()mul(228,381)mul(800,750)how()')<+)from(),when()'mul(292,596)*select()why():what(158,611)(,who()#mul(825,578)mul(990,239)!^~,$>mul(733,242)mul(575,863)why()*>&,}%!]^mul(613,249){#from()mul&]who()where()}+}}$+mul(94,794)mul(813,82)#mul(294,897)mul(995,245)!%#!^why()mul(411,763)/}</where()who()when()mul(629,353)<]when():do()*mul(657,319)**?select()^&%(<mul(900,780'~how():who()^when()<*mul(685,253)-<mul(465,59)&mul(570,657)-&mul(314,390){@what()%mul(730,685)}from()when()&],<}mul(952,18)what()/;?#^?from()mul(214!/'],(]don't()%?+]-?^^-&mul(108,152)&~(]do();:(mul(27,545)<how()how()how()*mul(20,169)&~how()how()when()@mul(679,797)[how(),/mul(744,612),mul(270,322)mul(803,691);{select(427,50)mul(805,251)'?}mul(308,255)[[!^!who(){<;where()mul(817,821)/<who() where(698,784)$when(867,773)]mul{>what(),)mul(952,776)<mul(215,986)<mul(617,955)?^,[@('where()mul(984{,~#)-how()mul(758,488)$mul(87,191)from()/;}from(595,784)!when()mul(284,414):*>mul(868,728) ':~$}mul(869,784#who()don't()%@-} (mul(766,260)']who()@^&select()<when()<mul(812,773)%from()who()why()[:^mul(998,763)when()-mul(34,331)where()who()/]]mul(854,2)do()#what()mul(342,466)+$@ ?,who()*mul(92,63)#'from()who()~;when();where()?mul(175,64)+;mul(128,996)?from()mul(123,206)select()>mul(723,930)what()what()from()-#~!mul(873,766)%:,?mul(520,521)& mul(407,520)select()$mul(547,416)~?}%^mul(677,996)mul(661,622)[~!mul(310,928)^;>-mul(740,171) /$#$*don't()select()>: &mul(306,628)*{select()$mul(705,686$/mul(803,660)mul(485,760)[select()'select(){@mul(917,878)#mul(188,324)(>}<:select()'mul(281,982)(select()},what()mul(730,931)}-#mulwhat(469,510)select()'from()where()#from()#do()/mul(869,458)
when()from()mul(912+{@mul(635,991)>}mul(158,871){[*{>'$*/ mul(686,481)mul(339,86)$>how()[when()mul(78,204)+&'mul(58,734)<{who()where()]';~mul(964,213)&select()where()@where(513,771)mul(471,186)'%$)@~<how()%how()mul(363;(]>({# mul(517,787){+%from()>]{,mul(762,604),~from()~+do()select()mul(827,656)$^>['-what()mul(318,236)select()'+>who(530,155)*mul(394,518)&#)select()from()!)select();:mul(805,79)why()}how()/&<mul(199,198)+mul(206,829)who()^}select()(]mul(216,978)@why()from()mul(129,689))~/,?where()mul(894,847)select() /#(]*mul(145what(119,568)mul(605,74)select() <when(246,601)-what();mul(642,999)@/;}+from():mul(423,41)mul@<+mul(90,853)what(565,411)![who():mul(971,380))who()mul(303,454)?#$#-'-do()who()]@}why()?!>?mul(924,569)who()$%where()]~*&[why(621,535)mul(152,407)[why()]#<!*select()#[mul(486,227who()*?)<where()%}mul(920,490)<$)#*$#mul(987,463)~?who()from()<(,mul(92,447)how():who()<+&why()>mul(478,24)mul(107,697)<why()who()%/>select()'>~mul(481,432) mul(248,61)^:+don't()mul(400,374)^]{who(){mul(959,329)from(){))]mul(566,182)}what()(where()>from()&don't()select()who():+?!]]/mul(766,741)why()@ !how()who()?select();<mul(434,357)%from()what()'^:!]when()?mul(798,701)#{,!:select()@what()%~do()]what() $&from():(&*mul(875,691)?%why()&[select();[/]mul(665,14)~:$*%mul(841,909)!<</#why()!]how(153,944)>mul(470,17)/mul(374,487)%@@mul(685,185)} {<#(mul(845,259)'why(230,429)[??^select()^>/mul(791,324)$how()/?mul(478,641)+/ <{(when()mul(794,547)why()[select()!*-mul(474,709)#select()# select()}select()mul(896,775)select()-where():!mul(817,123)mul(333,359)mul(433,461)mul(722,474)@'!@$mul(49,892) #(+,mul(726,435)what()>,;mul(957,798)) #%)$ mul(541,867)-?*# do() -]who(265,168){'*>{mul(770,902)+,-who()*what()mul(21,402)mul(843,622)~#mul(604,248)how()%(why()where()[;where()+mul(342,802))from()*when())#,<#,mul(439,954)}@-&)>+what()mul(593,520)>?,what();+,select()~mul(202,526)where()+#-]? mul(654,204)>why(),(]+mul(95,133)mul(626,152)@,[+mul(811,855)when()$when(387,144)when()who()mul(781,279))+&@&mul(77,160),why()%from()do())#mul(982,99):mul(722,476)mul(757,193)from()when()select()who(){mul(569,549)]*$mul(943,277)why()@who()}{from()!when()]mul(714,885),;*do()@where()^how()mul(941,709)~@{when(215,138)how()mul(772,310)~,what()>who()!?++]mul(858,573)-what()<(from()from()mul(254,457)mul(890,367)from()why()[mul(590,183)/@who()*#-^?~mul(446,447)<how()-)<}/how()mul(737,533),{>how()$select()mul(734,361)]~where();}when()mul(50,364):(where()-<^why()!&mul(692,682)from())&mul(949,43)mul(923,776)^/mul(987,377)!who()mul(286,329)#what()~from()^who()#/mul(13,658)why()>@(>]mul(592,423)mul(148,486)*mul(878,721)$%#how()what()mul(710,18):[#%do()where()@!(~mul(357,115)where()select()how()don't()mul(356,206)@,? how()^^what(295,729)[mul(759,861)from()*/select(334,18)&*how()@>what()mul(580,828)+;where()^;*select();what()mul(542,530)~where()[mul(549,51)'!mul(12,992)#why()don't()!;how()-(+{(mul(543,363)[what()from():mul(135,364)/select()mul(312,500)@where()[when()&$)]when(610,72)mul(215,533)~;who()}how()from()*)>~mul(522,58)@mul(402,510)!!;who()mul(867,26)-mul(25,987)?select()mul(973,76)why()&#{(/mul(148,345))^'%@when()-how()mul(233,85)

140
resources/2024/day4.txt Normal file
View File

@@ -0,0 +1,140 @@
MSSMSAMXSAMASMSMSAMMMMMMMXSXSMMSAMXSSSMXMSMMSMXMXSXMMSAMXMSSSSSSMSASMSSMSAMXMSMXSXSMMMXSSMAMXXMXSXMAMSAMXXMXAXXSASAMXMMAMMSSXSXMMXSMMXSXXMXX
AAMAMXAMMAMSAAAAMAMAAAAMMAMMSAAXAAMAAAMAXAMAAAAAASAMXSXMASMAXMAAMMASMAAAMAMAMAAMSAXAAXMXAXMASXSAMASAMXSSMMSSSMASAAAXMASMMAAMMMAMSMSASMSXAMAM
MMSSXSSSSSMAMSMSMMMXXSSSMXSAMMMMAXMMAMSXSSSXMSMMXSAMXMAMXXMMMMSMMXAXMXMSMASASMSMXASMMXMSAMMAMXMASAMXSMXMXAAAAXMXASMMMMSAMMXXAMAMAASAMAXSAMXA
XXAXAXAAAMXMXXAXAMSSMMXAMAM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SMMXXAXXSMSXSAASAMXASMMSMSASAXXAXMAMAMAMXSSMASXMMMXMMAASASAMAAAMAMAMXXXMMSMSMMAMSMSASAMXMMAAXASXMMAMMMMAMASMMXMMMAMXMAMXMSXAMSX
XXXXXMMASAMXXSXXXMSMMMAAAMXMXAMSMMXMAASXSMSMMMSAMMSASAAXSAXMXXSXSMAMMXMAMXMASXSAMXXAXMXAAAMXXMXMMMMMMASXMSMSSXSASAASMSASAXXMXSMSSMXMASAMXSMA
XXAMXXSXSMMXXMAMXMAAXMXMMAMMSAMAAAXSMXSAXAMXSASASAAMSMSXMXMMSAXASMXSMXSXMMSAMXSMSMSXMSSSSSMXMASXSAMXSMMAAMXMAMSAXAMMAMASMMMSAXSAAMSSMMMAMAMX
SSMMXXAMMMXMXMAMMMSSMASMXSAXMASMMMMXXAMXMSAXMASAMXSMXAMXXMSAAMMMMXMAMAMASMMSMMSAAASAMAAXMAXXSXSASMSMMAMMAMSSMMMMSXSMSMAMAAMMASMSMSAMMAXAXAMX
MAMSMMMMASAMASASXAAAMASMAMMSAMXAASMMMMSAMXAXMAMXMAXXMSMMSAMXSMSASXSAMXSAMAAXMAMSMMSAMXSMMXMMAMMAMXAMSSMMSMAAAXMASAAAXMSMSSSMXMAXMMASMSSMSSSM
MMMAAAXSASASASMSXMSSMASMXMXMASMSMMAAAAXXAASMSAMXMSSXMAAXMAMAAASASASXSAMXSMMSMMXXXXSAMAXAXAXAAMMAMSMXAMSAAMSSMMSAMSMMMMAAMAXMMSAXXMAMAAAAAMXA
SXSSSMXMASXMXSXMAMXAMXSAMXXXSXXMXSSMMSAXSAMAXXMXMMSXSMSMSAMSSXMXMAMSMXSAXMSXXXMXAMSMMXSSMSMSASMMMXSMXSMSSMMAMXMAXAMXSSMSMSMMMMMSMMASMSMMMSAS

1369
resources/2024/day5.txt Normal file

File diff suppressed because it is too large Load Diff

175
run.py Normal file
View File

@@ -0,0 +1,175 @@
from __future__ import annotations
from pathlib import Path
import subprocess
import sys
from typing import Optional
import shlex
import re
import os
import argparse
class Language:
def __init__(self, name: str, extension: str, run, build_extension: Optional[str] = None):
self.name = name
self.extension = extension
self.run = run
self.build_extension = build_extension
class Problem:
def __init__(self, language: Language, year: int, day: int, part: int, resource_location = None):
self.language = language
self.year = year
self.day = day
self.part = part
self.source_location = str(Path("src") / self.language.name / str(self.year) / f"day{self.day}" / f"part{self.part}.{self.language.extension}")
if resource_location:
self.resource_location = resource_location
else:
self.resource_location = str(Path("resources") / str(self.year) / f"day{self.day}.txt")
self.build_location = str(Path("build") / f"{self.language.name}{self.year}day{self.day}part{self.part}") + (f".{self.language.build_extension}" if self.language.build_extension else "")
self.resource_build_location = str(Path("build") / f"{self.language.name}{self.year}day{self.day}part{self.part}input")
def run(self, flags=None):
if flags is None:
flags = []
try:
self.language.run(self, flags=flags)
except RuntimeError:
pass
def print_command(command: str | list):
print(command if isinstance(command, str) else shlex.join([str(x) for x in command]))
def run_command(command: str | list[str], **kwargs):
print_command(command)
p = subprocess.run(command, **kwargs)
if p.returncode != 0:
print("process returned with error code", p.returncode)
raise RuntimeError()
def run_compile_command(command: str | list[str], **kwargs):
run_command(command, stdout=subprocess.DEVNULL, stderr=sys.stderr, **kwargs)
def run_run_command(command: str | list[str], **kwargs):
run_command(command, stdout=sys.stdout, stderr=sys.stderr, **kwargs)
def generate_commands_pladcl(problem: Problem, flags: Optional[list[str]]=None):
preprocess_location = "utilities/dc/preprocess.py"
run_compile_command(["pladclc", problem.source_location, "-o", problem.build_location] + (flags if flags else []))
run_compile_command(["python3", preprocess_location, problem.resource_location, "-o", problem.resource_build_location])
run_run_command(" ".join(["cat", problem.resource_build_location, "|", "dc", problem.build_location]), shell=True)
def generate_commands_pascal(problem: Problem, flags: Optional[list[str]]=None):
run_compile_command(["fpc", problem.source_location, "-o" + problem.build_location] + (flags if flags else []))
run_run_command([problem.build_location])
def generate_commands_z80(problem: Problem, flags:Optional[list[str]]=None):
simulator_location = "utilities/z80/z80sim"
preamble_location = "utilities/z80/preamble"
run_compile_command(["zasm", problem.source_location, "-o", problem.build_location] + (flags if flags else []))
run_compile_command(f"cat {preamble_location} {problem.build_location} > {problem.build_location + "0"}", shell=True)
run_run_command(f"echo q | {simulator_location} -x{problem.build_location}0", shell=True)
languages = {
"pladcl": Language("pladcl", "pdl", generate_commands_pladcl, build_extension="dc"),
"pascal": Language("pascal", "pas", generate_commands_pascal),
"python": Language("python", "py", lambda problem, flags: run_run_command(["python3", problem.source_location] + (flags if flags else []))),
"z80": Language("z80", "z80", generate_commands_z80, build_extension="bin")
}
def parse_problem(problem: str):
pattern = r"^([a-zA-Z0-9]+)(\d{4})d(?:ay)?(\d+)p(?:art)?(\d+)$"
if not (match := re.match(pattern, problem)):
raise ValueError(f"unable to understand problem \"{problem}\"")
language, year, day, part = match.groups()
if not language in languages:
raise ValueError(f"unknown language \"{language}\"")
language = languages[language]
year = int(year)
day = int(day)
part = int(part)
p = Problem(language, year, day, part)
return p
USAGE = """
for example, to run pladcl year 2024 day 3 part 1 with debug flags
python3 run.py pladcl2024day3part1 -d
extra flags are passed as is to the compiler"""
parser = argparse.ArgumentParser(
prog="run.py",
epilog=USAGE,
formatter_class = argparse.RawDescriptionHelpFormatter,
exit_on_error=False,
)
parser.add_argument("problem", type=str,
help="program to run [formatted as <language><year>day<day>part<part>]")
parser.add_argument("--resource-location", type=str,
help="override the default resource file (which is resources/<year>/day<day>.txt)")
def fail():
parser.print_usage()
print()
print("\n".join(parser.format_help().splitlines()[2:]))
quit(2)
if __name__ == "__main__":
try:
args, extra_flags = parser.parse_known_args(sys.argv[1:])
problem = parse_problem(args.problem)
if args.resource_location:
problem.resource_location = args.resource_location
if not os.path.exists(loc := problem.source_location):
raise ValueError(f"couldn't find the source file\nexpected it to be {loc}")
if not os.path.exists(loc := problem.resource_location):
raise ValueError(f"couldn't find the resource file\nexpected it to be {loc}")
problem.run(extra_flags)
except (argparse.ArgumentError, ValueError) as e:
print(e)
print()
fail()

View File

@@ -0,0 +1,53 @@
program day1part1;
var
file_: text;
start: string;
c: char;
first, last: char;
sum, value: int32;
(* Here the main program block starts *)
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day1.txt');
reset(file_);
{ initialize sum to 0 }
sum := 0;
{ until the file is empty }
while not eof(file_) do
begin
{ read a line from the file }
readln(file_, start);
{ fill in placeholders }
first := 'a';
last := 'a';
{ for each characters }
for c in start do
begin
{ if it is a number }
if (('0' <= c) and (c <= '9')) then
begin
{ set last to that number }
last := c;
{ if first hasn't been set, then set it as a number}
if (first = 'a') then
first := c
end;
end;
{ calculate the actual value of the number and add it to the sum }
val(concat(first, last), value);
sum := sum + value;
end;
{ print out that beautiful sum}
writeln(sum);
end.

View File

@@ -0,0 +1,75 @@
program day2part2;
uses sysutils;
var
file_: text;
start: string;
c: char;
first, last: char;
value, sum: int32;
names: array [0..9] of string = ('zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');
numbers: array [0..9] of char = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
i, j: int32;
s: string;
(* Here the main program block starts *)
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day1.txt');
reset(file_);
{ initialize sum to 0 }
sum := 0;
{ until the file is empty }
while not eof(file_) do
begin
{ read a line from the file }
readln(file_, start);
{ fill in placeholders }
first := 'a';
last := 'a';
{ for each characters }
for i := 1 to length(start) do
begin
c := start[i];
{ check for text number }
for j := 0 to 9 do
begin
{ compare the substring with the name of a number }
s := copy(start, i, length(names[j]));
if (comparestr(s, names[j]) = 0) then
begin
{ if it matches then this is a number }
c := numbers[j];
break;
end;
end;
{ if it is a number }
if (('0' <= c) and (c <= '9')) then
begin
{ set last to that number }
last := c;
{ if first hasn't been set, then set it as a number}
if (first = 'a') then
first := c
end;
end;
{ calculate the actual value of the number and add it to the sum }
val(first + last, value);
sum := sum + value;
end;
{ print out that beautiful sum }
writeln(sum);
end.

View File

@@ -0,0 +1,136 @@
program day10part1;
uses sysutils;
type
direction = (Left, Up, Right, Down, NA);
function step_path(var curr: array of int32; last_direction: direction; c: char): direction;
begin
// step_path := curr;
step_path := NA;
case last_direction of
Left:
begin
case c of
'-': step_path := Left;
'L': step_path := Up;
'F': step_path := Down;
end;
end;
Up:
begin
case c of
'|': step_path := Up;
'7': step_path := Left;
'F': step_path := Right;
end;
end;
Right:
begin
case c of
'-': step_path := Right;
'7': step_path := Down;
'J': step_path := Up;
end;
end;
Down:
begin
case c of
'|': step_path := Down;
'J': step_path := Left;
'L': step_path := Right;
end;
end;
end;
case step_path of
Up: curr[0] := curr[0] - 1;
Down: curr[0] := curr[0] + 1;
Left: curr[1] := curr[1] - 1;
Right: curr[1] := curr[1] + 1;
end;
if (last_direction = NA) then
writeln('bruh');
end;
var
file_: text;
map: array[1..1000] of string;
str: string;
count: int32;
steps: int32;
step: char;
s_loc, loc: array[0..1] of int32;
ld: direction;
i: int32;
{ node, left, right }
nodes: array[0..1000, 0..2] of string;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day10.txt');
reset(file_);
count := 1;
while not EOF(file_) do
begin
readln(file_, map[count]);
i := pos('S', map[count]);
if i <> 0 then
begin
s_loc[0] := count;
s_loc[1] := i;
end;
count := count + 1;
end;
loc := s_loc;
count := 0;
{ get possible initial directions }
if (map[s_loc[0], s_loc[1] - 1] = '-') or (map[s_loc[0], s_loc[1] - 1] = 'F') or (map[s_loc[0], s_loc[1] - 1] = 'L') then
begin
loc[1] := loc[1] - 1;
ld := Left;
end
else if (map[s_loc[0] - 1, s_loc[1]] = '|') or (map[s_loc[0] - 1, s_loc[1]] = '7') or (map[s_loc[0] - 1, s_loc[1]] = 'F') then
begin
loc[0] := loc[0] - 1;
ld := Up;
end
else
begin
{ if it's neither up nor left, then both right and down must be valid. }
{ pick right arbitrarily }
ld := Right;
loc[1] := loc[1] + 1;
end;
while (loc[0] <> s_loc[0]) or (loc[1] <> s_loc[1]) do
begin
count := count + 1;
ld := step_path(loc, ld, map[loc[0], loc[1]]);
end;
count := count + 1;
writeln(count div 2);
end.

View File

@@ -0,0 +1,276 @@
program day10part1;
uses sysutils;
type
direction = (Left, Up, Right, Down, NA);
blocktype = (Empty, Pipe, Red, Blue);
var
blocks: array[1..1000, 1..1000] of blocktype;
procedure replace_if_not_pipe(y: int32; x: int32; new_type: blocktype);
begin
if blocks[y, x] <> Pipe then
blocks[y, x] := new_type
end;
function step_path(var curr: array of int32; last_direction: direction; c: char): direction;
begin
// step_path := curr;
step_path := NA;
{ mark lefthand side as blue, righthand side as red }
case last_direction of
Left:
begin
replace_if_not_pipe(curr[0] - 1, curr[1], Red);
replace_if_not_pipe(curr[0] + 1, curr[1], Blue);
end;
Right:
begin
replace_if_not_pipe(curr[0] - 1, curr[1], Blue);
replace_if_not_pipe(curr[0] + 1, curr[1], Red);
end;
Down:
begin
replace_if_not_pipe(curr[0], curr[1] - 1, Red);
replace_if_not_pipe(curr[0], curr[1] + 1, Blue);
end;
Up:
begin
replace_if_not_pipe(curr[0], curr[1] - 1, Blue);
replace_if_not_pipe(curr[0], curr[1] + 1, Red);
end;
end;
case last_direction of
Left:
begin
case c of
'-': step_path := Left;
'L': step_path := Up;
'F': step_path := Down;
end;
end;
Up:
begin
case c of
'|': step_path := Up;
'7': step_path := Left;
'F': step_path := Right;
end;
end;
Right:
begin
case c of
'-': step_path := Right;
'7': step_path := Down;
'J': step_path := Up;
end;
end;
Down:
begin
case c of
'|': step_path := Down;
'J': step_path := Left;
'L': step_path := Right;
end;
end;
end;
{ mark lefthand side as blue, righthand side as red }
case step_path of
Left:
begin
replace_if_not_pipe(curr[0] - 1, curr[1], Red);
replace_if_not_pipe(curr[0] + 1, curr[1], Blue);
end;
Right:
begin
replace_if_not_pipe(curr[0] - 1, curr[1], Blue);
replace_if_not_pipe(curr[0] + 1, curr[1], Red);
end;
Down:
begin
replace_if_not_pipe(curr[0], curr[1] - 1, Red);
replace_if_not_pipe(curr[0], curr[1] + 1, Blue);
end;
Up:
begin
replace_if_not_pipe(curr[0], curr[1] - 1, Blue);
replace_if_not_pipe(curr[0], curr[1] + 1, Red);
end;
end;
{ move to the next pipe }
case step_path of
Up: curr[0] := curr[0] - 1;
Down: curr[0] := curr[0] + 1;
Left: curr[1] := curr[1] - 1;
Right: curr[1] := curr[1] + 1;
end;
if (last_direction = NA) then
writeln('bruh');
end;
var
file_: text;
map: array[1..1000] of string;
str: string;
count: int32;
width: int32;
steps: int32;
step: char;
s_loc, loc: array[0..1] of int32;
ld: direction;
i, j: int32;
{ node, left, right }
nodes: array[0..1000, 0..2] of string;
current: blocktype;
invalid: blocktype;
red_count, blue_count: int32;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day10.txt');
reset(file_);
count := 1;
while not EOF(file_) do
begin
readln(file_, map[count]);
i := pos('S', map[count]);
if i <> 0 then
begin
s_loc[0] := count;
s_loc[1] := i;
end;
count := count + 1;
end;
width := length(map[1]);
loc := s_loc;
{ get possible initial directions }
if (map[s_loc[0], s_loc[1] - 1] = '-') or (map[s_loc[0], s_loc[1] - 1] = 'F') or (map[s_loc[0], s_loc[1] - 1] = 'L') then
begin
loc[1] := loc[1] - 1;
ld := Left;
end
else if (map[s_loc[0] - 1, s_loc[1]] = '|') or (map[s_loc[0] - 1, s_loc[1]] = '7') or (map[s_loc[0] - 1, s_loc[1]] = 'F') then
begin
loc[0] := loc[0] - 1;
ld := Up;
end
else
begin
{ if it's neither up nor left, then both right and down must be valid. }
{ pick right arbitrarily }
ld := Right;
loc[1] := loc[1] + 1;
end;
// shitty memset
for i := 1 to count do
begin
for j := 1 to width do
begin
blocks[i, j] := Empty;
end;
end;
blocks[s_loc[0], s_loc[1]] := Pipe;
{ mark array of pipes, and set some red and blue squares }
while (loc[0] <> s_loc[0]) or (loc[1] <> s_loc[1]) do
begin
{ mark pipe }
blocks[loc[0], loc[1]] := Pipe;
ld := step_path(loc, ld, map[loc[0], loc[1]]);
end;
{ step one additional time }
ld := step_path(loc, ld, map[loc[0], loc[1]]);
{ fill in the map and count}
{ techincally filling in the map is uneccessary but it looks cool }
red_count := 0;
blue_count := 0;
for i := 1 to count - 1 do
begin
current := Empty;
for j := 1 to width do
begin
case blocks[i, j] of
Empty:
begin
blocks[i, j] := current;
case current of
Red: red_count := red_count + 1;
Blue: blue_count := blue_count + 1;
end;
end;
// Pipe you do nothing
Red:
begin
current := Red;
red_count := red_count + 1;
end;
Blue:
begin
current := Blue;
blue_count := blue_count + 1;
end;
end;
end;
{ if we're holding onto this at the end, then this is the color outside of the square}
if current <> Empty then
invalid := current
end;
{ print out the map }
for i := 1 to count - 1 do
begin
for j := 1 to width do
begin
case blocks[i, j] of
Empty: write(' ');
Pipe: write('█');
Red: write('▒');
Blue: write('░');
end;
end;
writeln();
end;
writeln(invalid, ' is bad color.');
writeln('Red count is ', red_count);
writeln('Blue count is ', blue_count);
end.

View File

@@ -0,0 +1,113 @@
program day11part1;
uses sysutils;
function dist_between(x1, x2: int32; empty_list: array of boolean): int32;
var
i: int32;
begin
{ swap operands so x1 is always smaller}
if (x2 < x1) then
begin
i := x2;
x2 := x1;
x1 := i;
end;
{ calculate distance }
dist_between := 0;
for i := x1 to x2 - 1 do
begin
dist_between := dist_between + 1;
{ if gap, increment by an additional 1 }
if empty_list[i] then
dist_between := dist_between + 1;
end;
end;
function galaxy_dist(g1, g2: array of int64; row_list, col_list: array of boolean): int32;
begin
galaxy_dist := dist_between(g1[0], g2[0], col_list) + dist_between(g1[1], g2[1], row_list);
end;
var
file_: text;
str: string;
galaxies: array[0..1000, 0..1] of int64;
galaxy_count: int32;
column_empty: array[1..1000] of boolean;
row_empty: array[1..1000] of boolean;
i, j: int32;
count: int32;
sum: int32;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day11.txt');
reset(file_);
{ set row/cols to empty }
for i := 0 to 1000 do
begin
column_empty[i] := true;
row_empty[i] := true;
end;
count := 0;
galaxy_count := 0;
{ read file }
while not EOF(file_) do
begin
count := count + 1;
readln(file_, str);
for i := 1 to length(str) do
begin
if str[i] = '#' then
begin
{ record this galaxy }
galaxy_count := galaxy_count + 1;
galaxies[galaxy_count][0] := i;
galaxies[galaxy_count][1] := count;
{ mark rows/cols as nonempty }
row_empty[count] := false;
column_empty[i] := false;
end;
end;
end;
sum := 0;
{ for each pair }
for i := 1 to galaxy_count do
begin
for j := i + 1 to galaxy_count do
begin
{ sum the pairwise distance }
sum := sum + galaxy_dist(galaxies[i], galaxies[j], row_empty, column_empty);
end;
end;
writeln('The sum is ', sum);
end.

View File

@@ -0,0 +1,113 @@
program day11part1;
uses sysutils;
function dist_between(x1, x2: int32; empty_list: array of boolean): int64;
var
i: int32;
begin
{ swap operands so x1 is always smaller}
if (x2 < x1) then
begin
i := x2;
x2 := x1;
x1 := i;
end;
{ calculate distance }
dist_between := 0;
for i := x1 to x2 - 1 do
begin
dist_between := dist_between + 1;
{ if gap, increment by an additional 999999 }
if empty_list[i] then
dist_between := dist_between + 999999;
end;
end;
function galaxy_dist(g1, g2: array of int64; row_list, col_list: array of boolean): int64;
begin
galaxy_dist := dist_between(g1[0], g2[0], col_list) + dist_between(g1[1], g2[1], row_list);
end;
var
file_: text;
str: string;
galaxies: array[0..1000, 0..1] of int64;
galaxy_count: int32;
column_empty: array[1..1000] of boolean;
row_empty: array[1..1000] of boolean;
i, j: int32;
count: int32;
sum: int64;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day11.txt');
reset(file_);
{ set row/cols to empty }
for i := 0 to 1000 do
begin
column_empty[i] := true;
row_empty[i] := true;
end;
count := 0;
galaxy_count := 0;
{ read file }
while not EOF(file_) do
begin
count := count + 1;
readln(file_, str);
for i := 1 to length(str) do
begin
if str[i] = '#' then
begin
{ record this galaxy }
galaxy_count := galaxy_count + 1;
galaxies[galaxy_count][0] := i;
galaxies[galaxy_count][1] := count;
{ mark rows/cols as nonempty }
row_empty[count] := false;
column_empty[i] := false;
end;
end;
end;
sum := 0;
{ for each pair }
for i := 1 to galaxy_count do
begin
for j := i + 1 to galaxy_count do
begin
{ sum the pairwise distance }
sum := sum + galaxy_dist(galaxies[i], galaxies[j], row_empty, column_empty);
end;
end;
writeln('The sum is ', sum);
end.

View File

@@ -0,0 +1,205 @@
{$mode objfpc}
program day12part1;
uses sysutils;
type
int32array = array of int32;
stringarray = array of string;
function sum(l: array of int32; start: int32 = 0): int32;
var
i: int32;
begin
sum := 0;
for i := start to length(l) - 1 do
sum := l[i] + sum;
end;
function split_to_int(s: string; delim: char): int32array ;
var
i, last_delim, count : int32;
c: char;
begin
{ there will always be at least one number }
count := 1;
{ count number of delimeters }
for c in s do
begin
if c = delim then
count := count + 1;
end;
{ allocate enough space for count}
setlength(split_to_int, count);
count := 0;
last_delim := 0;
{ second interation }
for i := 1 to length(s) do
begin
{ if this is a delimeter }
if s[i] = delim then
begin
{ add the value between this delimiter and the previous one to splitted }
val(
copy(s, last_delim + 1, i - last_delim - 1), split_to_int[count]
);
count := count + 1;
last_delim := i;
end;
end;
{ don't forget the final value }
val(
copy(s, last_delim + 1, length(s) - last_delim), split_to_int[count]
);
end;
function split_to_str(s: string; delim: char): stringarray;
var
i, last_delim, count : int32;
c: char;
begin
{ there will always be at least one number }
count := 1;
{ count number of delimeters }
for c in s do
begin
if c = delim then
count := count + 1;
end;
{ allocate enough space for count}
setlength(split_to_str, count);
count := 0;
last_delim := 0;
{ second interation }
for i := 1 to length(s) do
begin
{ if this is a delimeter }
if s[i] = delim then
begin
{ add the value between this delimiter and the previous one to splitted }
split_to_str[count] := copy(s, last_delim + 1, i - last_delim - 1);
count := count + 1;
last_delim := i;
end;
end;
{ don't forget the final value }
split_to_str[count] := copy(s, last_delim + 1, length(s) - last_delim)
end;
function will_fit(s: string; idx, length: int32): boolean;
var
i: int32;
begin
will_fit := true;
for i := idx to idx + length - 1 do
begin
if s[i] = '.' then
begin
will_fit := false;
break;
end;
end;
end;
function all_after_not(s: string; idx: int32; c: char): boolean;
var
i: int32;
begin
all_after_not := true;
for i := idx to length(s) do
begin
if s[i] = c then
begin
all_after_not := false;
break;
end;
end;
end;
function possibilties(s: string; l: array of int32; start_s: int32 = 1; start_l: int32 = 0): int32;
var
i: int32;
begin
possibilties := 0;
// writeln(s, l[start_l], length(l), start_s, start_l);
{ if there is only one spring left then }
if length(l) - start_l = 1 then
begin
{ check every possibility }
for i := start_s to length(s) - l[start_l] + 1 do
begin
{ if it will fit here, then it's valid }
if will_fit(s, i, l[start_l]) and all_after_not(s, i + l[start_l], '#') then
possibilties := possibilties + 1;
{ if we pass by a #, then it's not valid anymore as the # won't be filled }
if s[i] = '#' then
break;
end;
end
else
begin
for i := start_s to length(s) - sum(l, start_l) - length(l) + start_l + 2 do
begin
{ if it will fit and we aren't skipping a '#', recursively find possibilities }
if will_fit(s, i, l[start_l]) and (s[i + l[start_l]] <> '#') then
possibilties := possibilties + possibilties(s, l, i + l[start_l] + 1, start_l + 1);
{ if we pass by a #, then it's not valid anymore as the # won't be filled }
if s[i] = '#' then
break;
end;
end;
end;
var
s: string;
pattern: array of int32;
split: array of string;
file_: text;
total: int32;
begin
assign(file_, 'resources/2023/day12.txt');
reset(file_);
total := 0;
while not EOF(file_) do
begin
readln(file_, s);
split := split_to_str(s, ' ');
pattern := split_to_int(split[1], ',');
total := total + possibilties(split[0], pattern);
end;
writeln('The sum is ', total);
end.

View File

@@ -0,0 +1,250 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day12part1;
uses sysutils;
type
int64array = array of int64;
stringarray = array of string;
function sum(l: array of int64; start: int64 = 0): int64;
var
i: int64;
begin
sum := 0;
for i := start to length(l) - 1 do
sum := l[i] + sum;
end;
function split_to_int(s: string; delim: char): int64array ;
var
i, last_delim, count : int64;
c: char;
begin
{ there will always be at least one number }
count := 1;
{ count number of delimeters }
for c in s do
begin
if c = delim then
count := count + 1;
end;
{ allocate enough space for count}
setlength(split_to_int, count);
count := 0;
last_delim := 0;
{ second interation }
for i := 1 to length(s) do
begin
{ if this is a delimeter }
if s[i] = delim then
begin
{ add the value between this delimiter and the previous one to splitted }
val(
copy(s, last_delim + 1, i - last_delim - 1), split_to_int[count]
);
count := count + 1;
last_delim := i;
end;
end;
{ don't forget the final value }
val(
copy(s, last_delim + 1, length(s) - last_delim), split_to_int[count]
);
end;
function split_to_str(s: string; delim: char): stringarray;
var
i, last_delim, count : int64;
c: char;
begin
{ there will always be at least one number }
count := 1;
{ count number of delimeters }
for c in s do
begin
if c = delim then
count := count + 1;
end;
{ allocate enough space for count}
setlength(split_to_str, count);
count := 0;
last_delim := 0;
{ second interation }
for i := 1 to length(s) do
begin
{ if this is a delimeter }
if s[i] = delim then
begin
{ add the value between this delimiter and the previous one to splitted }
split_to_str[count] := copy(s, last_delim + 1, i - last_delim - 1);
count := count + 1;
last_delim := i;
end;
end;
{ don't forget the final value }
split_to_str[count] := copy(s, last_delim + 1, length(s) - last_delim)
end;
function will_fit(s: string; idx, length: int64): boolean;
var
i: int64;
begin
will_fit := true;
for i := idx to idx + length - 1 do
begin
if s[i] = '.' then
begin
will_fit := false;
break;
end;
end;
end;
function all_after_not(s: string; idx: int64; c: char): boolean;
var
i: int64;
begin
all_after_not := true;
for i := idx to length(s) do
begin
if s[i] = c then
begin
all_after_not := false;
break;
end;
end;
end;
var
cache: array[0..1000, 0..1000] of int64;
procedure clear_cache();
var
i, j: int64;
begin
for i := 0 to 1000 do
begin
for j:= 0 to 1000 do
begin
cache[i, j] := -1;
end;
end;
end;
function possibilties(s: string; l: array of int64; start_s: int64 = 1; start_l: int64 = 0): int64;
var
i: int64;
begin
possibilties := 0;
{ clear the cache if we r starting }
if start_l = 0 then
clear_cache();
{ return cache if we have the value }
if cache[start_s, start_l] <> -1 then
begin
possibilties := cache[start_s, start_l];
exit;
end;
{ if there is only one spring left then }
if length(l) - start_l = 1 then
begin
{ check every possibility }
for i := start_s to length(s) - l[start_l] + 1 do
begin
{ if it will fit here, then it's valid }
if will_fit(s, i, l[start_l]) and all_after_not(s, i + l[start_l], '#') then
possibilties := possibilties + 1;
{ if we pass by a #, then it's not valid anymore as the # won't be filled }
if s[i] = '#' then
break;
end;
end
else
begin
for i := start_s to length(s) - sum(l, start_l) - length(l) + start_l + 2 do
begin
{ if it will fit and we aren't skipping a '#', recursively find possibilities }
if will_fit(s, i, l[start_l]) and (s[i + l[start_l]] <> '#') then
possibilties := possibilties + possibilties(s, l, i + l[start_l] + 1, start_l + 1);
{ if we pass by a #, then it's not valid anymore as the # won't be filled }
if s[i] = '#' then
break;
end;
end;
cache[start_s, start_l] := possibilties;
end;
function duplicate_int_array(arr: int64array; times: int64): int64array;
var
i: int64;
begin
setlength(duplicate_int_array, length(arr) * times);
for i := 0 to length(arr) * times - 1 do
begin
duplicate_int_array[i] := arr[i mod length(arr)];
end;
end;
var
s: string;
pattern: array of int64;
split: array of string;
file_: text;
total: int64;
begin
assign(file_, 'resources/2023/day12.txt');
reset(file_);
total := 0;
while not EOF(file_) do
begin
readln(file_, s);
split := split_to_str(s, ' ');
pattern := split_to_int(split[1], ',');
//total := total + possibilties(split[0], pattern);
total := total + possibilties(split[0] + '?' + split[0] + '?' + split[0] + '?' + split[0] + '?' + split[0],
duplicate_int_array(pattern, 5));
end;
writeln('The sum is ', total);
end.

View File

@@ -0,0 +1,142 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day13part1;
uses sysutils;
type
Tmap = record
map: array[1..100] of string;
height: int32;
width: int32;
end;
function max(a, b: int32): int32;
begin
max := a;
if b > a then
max := b;
end;
{ check for mirrors that lay vertically (column mirror) }
function check_v_mirror(map: Tmap; col: int32): boolean;
var
i, j: int32;
begin
check_v_mirror := true;
for j := 1 to map.height do
begin
for i := max(1, 2 * col - map.width + 1) to col do
begin
// writeln(i, ' ', col*2 - i);
if map.map[j, i] <> map.map[j, col * 2 - i + 1] then
begin
check_v_mirror := false;
break
end;
end;
if not check_v_mirror then
break;
end;
check_v_mirror := check_v_mirror;
end;
{ check for mirrors that lay vertically (column mirror) }
function check_h_mirror(map: Tmap; row: int32): boolean;
var
i, j: int32;
begin
check_h_mirror := true;
for j := 1 to map.width do
begin
for i := max(1, 2 * row - map.height + 1) to row do
begin
//writeln(i, ' ', row*2 - i + 1);
if map.map[i, j] <> map.map[row * 2 - i + 1, j] then
begin
check_h_mirror := false;
break
end;
end;
if not check_h_mirror then
break;
end;
end;
function get_mirror(map: Tmap): int32;
var
i: int32;
begin
{ check vertical ones first }
for i := 1 to map.width - 1 do
begin
if check_v_mirror(map, i) then
begin
get_mirror := i;
exit;
end;
end;
{ check horizontal ones now }
for i := 1 to map.height - 1 do
begin
if check_h_mirror(map, i) then
begin
get_mirror := i shl 6 + i shl 5 + i shl 2;
exit;
end;
end;
end;
var
map: Tmap;
file_: text;
s: string;
total, map_count: int32;
begin
assign(file_, 'resources/2023/day13.txt');
reset(file_);
total := 0;
map_count := 0;
while not EOF(file_) do
begin
readln(file_, s);
writeln(s);
if length(s) = 0 then
begin
// come back to this
total := total + get_mirror(map);
map_count := 0;
end
else
begin
map_count := map_count + 1;
map.map[map_count] := s;
map.height := map_count;
map.width := length(s);
end;
end;
writeln(total);
end.

View File

@@ -0,0 +1,149 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day13part1;
uses sysutils;
type
Tmap = record
map: array[1..100] of string;
height: int32;
width: int32;
end;
function max(a, b: int32): int32;
begin
max := a;
if b > a then
max := b;
end;
{ check for mirrors that lay vertically (column mirror) }
function check_v_mirror(map: Tmap; col: int32): boolean;
var
i, j: int32;
errors: int32;
begin
errors := 0;
for j := 1 to map.height do
begin
for i := max(1, 2 * col - map.width + 1) to col do
begin
// writeln(i, ' ', col*2 - i);
if map.map[j, i] <> map.map[j, col * 2 - i + 1] then
begin
errors := errors + 1;
if errors > 1 then
break;
end;
end;
if errors > 1 then
break;
end;
check_v_mirror := errors = 1;
end;
{ check for mirrors that lay vertically (column mirror) }
function check_h_mirror(map: Tmap; row: int32): boolean;
var
i, j: int32;
errors: int32;
begin
errors := 0;
for j := 1 to map.width do
begin
for i := max(1, 2 * row - map.height + 1) to row do
begin
//writeln(i, ' ', row*2 - i + 1);
if map.map[i, j] <> map.map[row * 2 - i + 1, j] then
begin
errors := errors + 1;
if errors > 1 then
break;
end;
end;
if errors > 1 then
break;
end;
check_h_mirror := errors = 1;
end;
function get_mirror(map: Tmap): int32;
var
i: int32;
begin
{ check vertical ones first }
for i := 1 to map.width - 1 do
begin
if check_v_mirror(map, i) then
begin
get_mirror := i;
exit;
end;
end;
{ check horizontal ones now }
for i := 1 to map.height - 1 do
begin
if check_h_mirror(map, i) then
begin
get_mirror := i shl 6 + i shl 5 + i shl 2;
exit;
end;
end;
if get_mirror = 0 then
writeln('oh fuck');
end;
var
map: Tmap;
file_: text;
s: string;
total, map_count: int32;
begin
assign(file_, 'resources/2023/day13.txt');
reset(file_);
total := 0;
map_count := 0;
while not EOF(file_) do
begin
readln(file_, s);
if length(s) = 0 then
begin
total := total + get_mirror(map);
map_count := 0;
end
else
begin
map_count := map_count + 1;
map.map[map_count] := s;
map.height := map_count;
map.width := length(s);
end;
end;
writeln(total);
end.

View File

@@ -0,0 +1,61 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day14part1;
uses sysutils;
var
file_: text;
s: string;
map: array[1..1000] of string;
current_boulders: int32;
height, width: int32;
i, j, k: int32;
sum: int32;
begin
assign(file_, 'resources/2023/day14.txt');
reset(file_);
height := 1;
fillchar(map[1], 255, '#');
while not eof(file_) do
begin
height := height + 1;
readln(file_, map[height]);
end;
width := length(map[2]);
sum := 0;
for i := 1 to width do
begin
current_boulders := 0;
for j := 1 to height do
begin
case map[height - j + 1][i] of
'O': current_boulders := current_boulders + 1;
'#':
begin
for k := j - current_boulders to j - 1 do
begin
sum := sum + k;
end;
current_boulders := 0;
end;
end;
end;
end;
writeln('sum: ', sum);
end.

View File

@@ -0,0 +1,290 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day14part1;
uses sysutils;
procedure print_map(map: array of string; height: int32);
var
i: int32;
begin
for i := 0 to height - 1 do
writeln(map[i]);
end;
procedure copy_map(map: array of string; var map2: array of string; height: int32);
var
i: int32;
begin
for i := 0 to height - 1 do
map2[i] := map[i]
end;
procedure shift_up(var map: array of string; height: int32; width: int32);
var
i, j, k: int32;
current_boulders: int32;
begin
for i := 1 to width do
begin
current_boulders := 0;
for j := 1 to height do
begin
case map[height - j][i] of
'O':
begin
current_boulders := current_boulders + 1;
map[height - j][i] := '.'
end;
'#':
begin
for k := height - j + 1 to height - j + current_boulders do
begin
map[k][i] := 'O'
end;
current_boulders := 0;
end;
end;
end;
for k := 0 to current_boulders - 1 do
begin
map[k][i] := 'O'
end;
current_boulders := 0;
end;
end;
procedure shift_left(var map: array of string; height: int32; width: int32);
var
i, j, k: int32;
current_boulders: int32;
begin
for i := 0 to height - 1 do
begin
current_boulders := 0;
for j := 0 to width - 1 do
begin
case map[i][width - j] of
'O':
begin
current_boulders := current_boulders + 1;
map[i][width - j] := '.'
end;
'#':
begin
for k := width - j + 1 to width - j + current_boulders do
begin
map[i][k] := 'O'
end;
current_boulders := 0;
end;
end;
end;
for k := 1 to current_boulders do
begin
map[i][k] := 'O'
end;
current_boulders := 0;
end;
end;
procedure shift_down(var map: array of string; height: int32; width: int32);
var
i, j, k: int32;
current_boulders: int32;
begin
for i := 1 to width do
begin
current_boulders := 0;
for j := 0 to height - 1 do
begin
case map[j][i] of
'O':
begin
current_boulders := current_boulders + 1;
map[j][i] := '.'
end;
'#':
begin
for k := j - current_boulders to j - 1 do
begin
map[k][i] := 'O'
end;
current_boulders := 0;
end;
end;
end;
for k := height - current_boulders to height - 1 do
begin
map[k][i] := 'O'
end;
current_boulders := 0;
end;
end;
procedure shift_right(var map: array of string; height: int32; width: int32);
var
i, j, k: int32;
current_boulders: int32;
begin
for i := 0 to height - 1 do
begin
current_boulders := 0;
for j := 1 to width do
begin
case map[i][j] of
'O':
begin
current_boulders := current_boulders + 1;
map[i][j] := '.'
end;
'#':
begin
for k := j - current_boulders to j - 1 do
begin
map[i][k] := 'O'
end;
current_boulders := 0;
end;
end;
end;
for k := width - current_boulders + 1 to width do
begin
map[i][k] := 'O'
end;
current_boulders := 0;
end;
end;
procedure spin_cycle(var map: array of string; height: int32; width: int32);
begin
shift_up(map, height, width);
shift_left(map, height, width);
shift_down(map, height, width);
shift_right(map, height, width);
end;
function calculate_load(map: array of string; height: int32): int32;
var
i: int32;
c: char;
begin
calculate_load := 0;
for i := 0 to height - 1 do
begin
for c in map[i] do
begin
if c = 'O' then
calculate_load := calculate_load + height - i;
end;
end;
end;
function strcomp(s1: string; s2: string): boolean;
var
i: int32;
begin
strcomp := true;
for i := 1 to length(s1) do
begin
if (s1[i] <> s2[i]) then
begin
strcomp := false;
break;
end;
end;
end;
function map_equal(map: array of string; map2: array of string; height: int32): boolean;
var
i: int32;
begin
map_equal := true;
for i := 0 to height - 1 do
begin
if not strcomp(map[i], map2[i]) then
begin
map_equal := false;
break;
end;
end;
end;
var
file_: text;
map: array[1..10000, 1..100] of string;
values: array[1..10000] of int32;
height, width: int32;
i, j: int32;
finished: boolean;
wanted: int32;
begin
assign(file_, 'resources/2023/day14.txt');
reset(file_);
height := 0;
while not eof(file_) do
begin
height := height + 1;
readln(file_, map[1, height]);
end;
width := length(map[1, 1]);
values[1] := calculate_load(map[1], height);
finished := false;
for i := 2 to 100000 do
begin
copy_map(map[i - 1], map[i], height);
spin_cycle(map[i], height, width);
values[i] := calculate_load(map[i], height);
writeln('Found value ', values[i], ' for the ', i, 'th spin cycle');
for j := 1 to i - 1 do
begin
if map_equal(map[i], map[j], height) then
begin
writeln('This map is equal to the ', j, 'th map');
finished := true;
break;
end;
end;
if finished then
break;
end;
wanted := 1000000000;
writeln('This map has a cycle length of ', i - j, 'x + ', j);
writeln('This places ', wanted, ' at position ', (wanted - j) mod (i - j) + j + 1, ' in the cycle');
writeln('It would have a total load of ', values[(wanted - j) mod (i - j) + j + 1]);
end.

View File

@@ -0,0 +1,85 @@
{$mode objfpc}
program day12part1;
uses sysutils;
type
stringarray = array of string;
function split_to_str(s: AnsiString; delim: char): stringarray;
var
i, last_delim, count : int32;
c: char;
begin
{ there will always be at least one number }
count := 1;
{ count number of delimeters }
for c in s do
begin
if c = delim then
count := count + 1;
end;
{ allocate enough space for count}
setlength(split_to_str, count);
count := 0;
last_delim := 0;
{ second interation }
for i := 1 to length(s) do
begin
{ if this is a delimeter }
if s[i] = delim then
begin
{ add the value between this delimiter and the previous one to splitted }
split_to_str[count] := copy(s, last_delim + 1, i - last_delim - 1);
count := count + 1;
last_delim := i;
end;
end;
{ don't forget the final value }
split_to_str[count] := copy(s, last_delim + 1, length(s) - last_delim)
end;
function hash(s: string): int32;
var
c: char;
begin
hash := 0;
for c in s do
hash := ((hash + ord(c)) * 17) and 255;
end;
var
s: AnsiString;
to_hash: array of string;
split: array of string;
file_: text;
sum: int32;
begin
assign(file_, 'resources/2023/day15.txt');
reset(file_);
readln(file_, s);
to_hash := split_to_str(s, ',');
writeln(length(to_hash));
sum := 0;
for s in to_hash do
sum := sum + hash(s);
writeln('The sum is ', sum);
end.

View File

@@ -0,0 +1,194 @@
{$mode objfpc}
program day12part1;
uses sysutils;
type
stringarray = array of string;
lens = record
label_: string;
focal: int32;
end;
function split_to_str(s: AnsiString; delim: char): stringarray;
var
i, last_delim, count : int32;
c: char;
begin
{ there will always be at least one number }
count := 1;
{ count number of delimeters }
for c in s do
begin
if c = delim then
count := count + 1;
end;
{ allocate enough space for count}
setlength(split_to_str, count);
count := 0;
last_delim := 0;
{ second interation }
for i := 1 to length(s) do
begin
{ if this is a delimeter }
if s[i] = delim then
begin
{ add the value between this delimiter and the previous one to splitted }
split_to_str[count] := copy(s, last_delim + 1, i - last_delim - 1);
count := count + 1;
last_delim := i;
end;
end;
{ don't forget the final value }
split_to_str[count] := copy(s, last_delim + 1, length(s) - last_delim)
end;
function streq(s1: string; s2: string): boolean;
var
i: int32;
begin
streq := true;
for i := 1 to length(s1) do
begin
if (s1[i] <> s2[i]) then
begin
streq := false;
break;
end;
end;
end;
function hash(s: string): int32;
var
c: char;
begin
hash := 0;
for c in s do
hash := ((hash + ord(c)) * 17) and 255;
end;
var
{ ideally a linked list would be nice for the second dim, but eh.}
boxes: array[0..255, 1..100] of lens;
b_length: array[0..255] of int32;
procedure insert_lens(l: string; f: int32);
var
hvalue: int32;
i: int32;
begin
hvalue := hash(l);
{ check for duplicate }
for i := 1 to b_length[hvalue] do
begin
if streq(boxes[hvalue, i].label_, l) then
begin
boxes[hvalue, i].focal := f;
exit;
end;
end;
{ add to end }
b_length[hvalue] := b_length[hvalue] + 1;
boxes[hvalue, b_length[hvalue]].label_ := l;
boxes[hvalue, b_length[hvalue]].focal := f;
end;
procedure remove_lens(l: string);
var
hvalue: int32;
i: int32;
shifting: boolean;
begin
hvalue := hash(l);
shifting := false;
for i := 1 to b_length[hvalue] do
begin
if shifting then
boxes[hvalue, i - 1] := boxes[hvalue, i]
else if streq(boxes[hvalue, i].label_, l) then
shifting := true;
end;
if shifting then
b_length[hvalue] := b_length[hvalue] - 1;
end;
procedure write_boxes();
var
i, j: int32;
begin
for i := 0 to 255 do
begin
if b_length[i] <> 0 then
begin
write('Box ', i, ': ');
for j := 1 to b_length[i] do
begin
write('[', boxes[i, j].label_, ' ', boxes[i, j].focal, '] ');
end;
writeln();
end;
end;
end;
var
s: AnsiString;
to_hash: array of string;
split: array of string;
file_: text;
i, j: int32;
sum: int32;
begin
assign(file_, 'resources/2023/day15.txt');
reset(file_);
readln(file_, s);
to_hash := split_to_str(s, ',');
{ fill boxes }
for s in to_hash do
begin
if s[length(s)] = '-' then
remove_lens(copy(s, 0, length(s) - 1))
else if s[length(s) - 1] = '=' then
begin
val(s[length(s)], i);
insert_lens(copy(s, 0, length(s) - 2), i);
end;
end;
{ sum }
sum := 0;
for i := 0 to 255 do
for j := 1 to b_length[i] do
sum := sum + (i + 1) * j * boxes[i, j].focal;
write_boxes();
writeln('The sum is ', sum);
end.

View File

@@ -0,0 +1,146 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day16part1;
uses sysutils;
type
Tdirection = (Left, Up, Right, Down, NA);
var
map: array[1..1000] of string;
illuminated: array[1..1000, 1..1000] of boolean;
splitted: array[1..1000, 1..1000] of boolean;
height, width: int32;
procedure print_illuminated();
var
i, j: int32;
begin
for i := 1 to height do
begin
for j := 1 to width do
case illuminated[i, j] of
true: write('#');
false: write('.');
end;
writeln();
end;
end;
function sum_illuminated(): int32;
var
i, j: int32;
begin
sum_illuminated := 0;
for i := 1 to height do
for j := 1 to width do
if illuminated[i, j] then
sum_illuminated := sum_illuminated + 1;
end;
procedure step_illumination(x, y: int32; dir: Tdirection);
begin
{ range check }
if (x < 1) or (x > width) or (y < 1) or (y > height) then
exit;
writeln('(', x, ',', y, ')');
illuminated[y, x] := true;
{ nested case my beloved }
case map[y, x] of
'.':
begin
{ continue same direction }
case dir of
Up: step_illumination(x, y - 1, Up);
Left: step_illumination(x - 1, y, Left);
Down: step_illumination(x, y + 1, Down);
Right: step_illumination(x + 1, y, Right);
end;
end;
'/':
begin
{ reflect direction }
case dir of
Up: step_illumination(x + 1, y, Right);
Left: step_illumination(x, y + 1, Down);
Down: step_illumination(x - 1, y, Left);
Right: step_illumination(x, y - 1, Up);
end;
end;
'\':
begin
{ reflect direction but in the other way}
case dir of
Up: step_illumination(x - 1, y, Left);
Left: step_illumination(x, y - 1, Up);
Down: step_illumination(x + 1, y, Right);
Right: step_illumination(x, y + 1, Down);
end;
end;
'|':
begin
{ up down passthrough, left right split }
case dir of
Up: step_illumination(x, y - 1, Up);
Down: step_illumination(x, y + 1, Down);
Left, Right:
begin
if not splitted[y, x] then // so we don't split forever in a loop
begin
splitted[y, x] := true;
step_illumination(x, y - 1, Up);
step_illumination(x, y + 1, Down);
end;
end;
end;
end;
'-':
begin
{ lr passthrough, ud split }
case dir of
Left: step_illumination(x - 1, y, Left);
Right: step_illumination(x + 1, y, Right);
Up, Down:
begin
if not splitted[y, x] then // so we don't split forever in a loop
begin
splitted[y, x] := true;
step_illumination(x - 1, y, Left);
step_illumination(x + 1, y, Right);
end;
end;
end;
end;
end;
end;
var
file_: text;
begin
assign(file_, 'resources/2023/day16.txt');
reset(file_);
height := 0;
while not eof(file_) do
begin
height := height + 1;
readln(file_, map[height]);
end;
width := length(map[1]);
step_illumination(1, 1, Right);
print_illuminated();
writeln('Total illuminated is ', sum_illuminated());
end.

View File

@@ -0,0 +1,219 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day16part1;
uses sysutils;
type
Tdirection = (Left, Up, Right, Down, NA);
var
map: array[1..1000] of string;
illuminated: array[1..1000, 1..1000] of boolean;
splitted: array[1..1000, 1..1000] of boolean;
height, width: int32;
procedure print_illuminated();
var
i, j: int32;
begin
for i := 1 to height do
begin
for j := 1 to width do
case illuminated[i, j] of
true: write('#');
false: write('.');
end;
writeln();
end;
end;
function sum_illuminated(): int32;
var
i, j: int32;
begin
sum_illuminated := 0;
for i := 1 to height do
for j := 1 to width do
if illuminated[i, j] then
sum_illuminated := sum_illuminated + 1;
end;
procedure reset_illuminated_splitted();
var
i, j: int32;
begin
for i := 1 to height do
for j := 1 to width do
begin
illuminated[j, i] := false;
splitted[j, i] := false;
end;
end;
procedure step_illumination(x, y: int32; dir: Tdirection);
begin
{ range check }
if (x < 1) or (x > width) or (y < 1) or (y > height) then
exit;
illuminated[y, x] := true;
{ nested case my beloved }
case map[y, x] of
'.':
begin
{ continue same direction }
case dir of
Up: step_illumination(x, y - 1, Up);
Left: step_illumination(x - 1, y, Left);
Down: step_illumination(x, y + 1, Down);
Right: step_illumination(x + 1, y, Right);
end;
end;
'/':
begin
{ reflect direction }
case dir of
Up: step_illumination(x + 1, y, Right);
Left: step_illumination(x, y + 1, Down);
Down: step_illumination(x - 1, y, Left);
Right: step_illumination(x, y - 1, Up);
end;
end;
'\':
begin
{ reflect direction but in the other way}
case dir of
Up: step_illumination(x - 1, y, Left);
Left: step_illumination(x, y - 1, Up);
Down: step_illumination(x + 1, y, Right);
Right: step_illumination(x, y + 1, Down);
end;
end;
'|':
begin
{ up down passthrough, left right split }
case dir of
Up: step_illumination(x, y - 1, Up);
Down: step_illumination(x, y + 1, Down);
Left, Right:
begin
if not splitted[y, x] then // so we don't split forever in a loop
begin
splitted[y, x] := true;
step_illumination(x, y - 1, Up);
step_illumination(x, y + 1, Down);
end;
end;
end;
end;
'-':
begin
{ lr passthrough, ud split }
case dir of
Left: step_illumination(x - 1, y, Left);
Right: step_illumination(x + 1, y, Right);
Up, Down:
begin
if not splitted[y, x] then // so we don't split forever in a loop
begin
splitted[y, x] := true;
step_illumination(x - 1, y, Left);
step_illumination(x + 1, y, Right);
end;
end;
end;
end;
end;
end;
var
file_: text;
max: int32;
i, t: int32;
// for pretty printing
max_dir: Tdirection;
max_idx: int32;
begin
assign(file_, 'resources/2023/day16.txt');
reset(file_);
height := 0;
while not eof(file_) do
begin
height := height + 1;
readln(file_, map[height]);
end;
width := length(map[1]);
max := -1;
max_dir := NA;
max_idx := -1;
{ check up + down }
for i := 1 to width do
begin
step_illumination(i, 1, Down);
t := sum_illuminated();
reset_illuminated_splitted();
if t > max then
begin
max := t;
max_dir := Down;
max_idx := i;
end;
step_illumination(i, height, Up);
t := sum_illuminated();
reset_illuminated_splitted();
if t > max then
begin
max := t;
max_dir := Up;
max_idx := i;
end;
end;
{ check left + right }
for i := 1 to height do
begin
step_illumination(1, i, Right);
t := sum_illuminated();
reset_illuminated_splitted();
if t > max then
begin
max := t;
max_dir := Right;
max_idx := i;
end;
step_illumination(width, i, Left);
t := sum_illuminated();
reset_illuminated_splitted();
if t > max then
begin
max := t;
max_dir := Left;
max_idx := i;
end;
end;
writeln('The best configuration is going ', max_dir, ' at index ', max_idx);
writeln('The max illumination is ', max);
end.

View File

@@ -0,0 +1,14 @@
{$mode objfpc}
{$RANGECHECKS ON}
program day17part1;
uses sysutils;
type
Tnode = record
x, y: int32;
end;
begin
end.

View File

@@ -0,0 +1,23 @@
// i wrote this but i didn't use it
// might be useful for the future;
var
queue: array[0..1000] of Tnode;
queue_start, queue_length: int32;
procedure enqueue(node: Tnode);
begin
queue[queue_start + queue_length] := node;
inc(queue_length);
end;
function dequeue(): Tnode;
begin
dequeue := queue[queue_start];
inc(queue_start);
dec(queue_length);
end;
var
a, b: Tnode;

View File

@@ -0,0 +1,141 @@
program day2part2;
var
file_: text;
str: string;
sum, game: int32;
state: int32;
number: int32;
i: int32;
c: char;
red_limit: int32 = 12;
green_limit: int32 = 13;
blue_limit: int32 = 14;
(* Here the main program block starts *)
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day2.txt');
reset(file_);
{ initialize sum and count to 0 }
game := 0;
sum := 0;
{ until the file is empty }
while not eof(file_) do
begin
{ increment game counter }
game := game + 1;
{ assume this game is fine and valid }
sum := sum + game;
{ read a line from the file }
readln(file_, str);
{ state of current searching }
state := 0;
{ 0 = initial, going to colon -> 1}
{ 1 = wasting a space, resetting number -> 2}
{ 2 = searching for number -> 3}
{ 3 = checking color -> 4 }
{ 4 = waiting for space -> 2}
for c in str do
begin
{ holy case statement. }
case state of
{seeking to first colon}
0:
begin
{colon, move to state 1}
if (c = ':') then
state := 1
end;
{wasting a space}
1:
begin
{move to state 2, initialize number}
state := 2;
number := 0;
end;
{reading number}
2:
begin
{if number}
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, i);
number := number * 10 + i;
end;
{at the end move to state 3}
if (c = ' ') then
state := 3
end;
{check color}
3:
begin
{check red}
if (c = 'r') then
begin
{if there's too many}
if (number > red_limit) then
begin
{set this game as invalid and break}
sum := sum - game;
break;
end;
end;
{check blue}
if (c = 'b') then
begin
{if there's too many}
if (number > blue_limit) then
begin
{set this game as invalid and break}
sum := sum - game;
break;
end;
end;
{check green}
if (c = 'g') then
begin
{if there's too many}
if (number > green_limit) then
begin
{set this game as invalid and break}
sum := sum - game;
break;
end;
end;
{if we're still here, move to state 4}
state := 4;
end;
{wait for a space}
4:
begin
if (c = ' ') then
begin
{reset number and go back to state 2}
number := 0;
state := 2;
end;
end;
end;
end;
end;
{ print out that beautiful sum }
writeln(sum);
end.

View File

@@ -0,0 +1,130 @@
program day2part2;
var
file_: text;
str: string;
sum: int32;
state: int32;
number: int32;
i: int32;
c: char;
rcount, gcount, bcount: int32;
(* Here the main program block starts *)
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day2.txt');
reset(file_);
{ initialize sum to 0 }
sum := 0;
{ until the file is empty }
while not eof(file_) do
begin
{ read a line from the file }
readln(file_, str);
{ state of current searching }
state := 0;
{ 0 = initial, going to colon -> 1}
{ 1 = wasting a space, resetting number -> 2}
{ 2 = searching for number -> 3}
{ 3 = checking color -> 4 }
{ 4 = waiting for space -> 2}
{ initialize counts to zero }
rcount := 0;
bcount := 0;
gcount := 0;
for c in str do
begin
{ holy case statement. }
case state of
{seeking to first colon}
0:
begin
{colon, move to state 1}
if (c = ':') then
state := 1
end;
{wasting a space}
1:
begin
{move to state 2, initialize number}
state := 2;
number := 0;
end;
{reading number}
2:
begin
{if number}
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, i);
number := number * 10 + i;
end;
{at the end move to state 3}
if (c = ' ') then
state := 3
end;
{update color}
3:
begin
{check red}
if (c = 'r') then
begin
{update red if it's max}
if (number > rcount) then
rcount := number
end;
{check blue}
if (c = 'b') then
begin
{update blue if it's max}
if (number > bcount) then
bcount := number
end;
{check green}
if (c = 'g') then
begin
{update green if it's max}
if (number > gcount) then
gcount := number
end;
{if we're still here, move to state 4}
state := 4;
end;
{wait for a space}
4:
begin
if (c = ' ') then
begin
{reset number and go back to state 2}
number := 0;
state := 2;
end;
end;
end;
end;
{ increase sum }
sum := sum + rcount * bcount * gcount;
end;
{ print out that beautiful sum }
writeln(sum);
end.

View File

@@ -0,0 +1,238 @@
program day3part1;
uses sysutils;
var
file_: text;
prev, curr, next: string;
sum, game: int32;
state: int32;
number: int32;
valid: boolean;
i, b: int32;
c: char;
LINE_LENGTH: int32 = 140;
function is_symbol(str: string; ind: int32): boolean;
begin
is_symbol := ((not ((ind < 1) or (ind > LINE_LENGTH))) and (('0' > str[ind]) or (str[ind] > '9')) and (str[ind] <> '.'));
end;
function is_ok(prev: string; curr: string; next: string; ind: int32): boolean;
begin
is_ok := is_symbol(curr, i-1);
is_ok := (is_ok or is_symbol(curr, i+1));
is_ok := (is_ok or is_symbol(next, i-1));
is_ok := (is_ok or is_symbol(next, i));
is_ok := (is_ok or is_symbol(next, i+1));
is_ok := (is_ok or is_symbol(prev, i-1));
is_ok := (is_ok or is_symbol(prev, i));
is_ok := (is_ok or is_symbol(prev, i+1));
end;
(* Here the main program block starts *)
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day3.txt');
reset(file_);
{ initialize sum and count to 0 }
sum := 0;
{ read the first two lines }
readln(file_, curr);
readln(file_, next);
writeln(length(curr));
writeln(booltostr(true));
writeln(booltostr(false));
{ writeln(curr); }
{ writeln(next); }
state := 0;
number := 0;
{ 0 : waiting for number }
{ 1 : reading number }
{ first loop }
for i := 1 to LINE_LENGTH do
begin
c := curr[i];
case state of
{waiting for number}
0:
begin
{number}
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, number);
valid := false;
state := 1;
valid := (valid or is_ok(next, curr, next, i-1));
end;
end;
{reading number and checking true}
1:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
{look for symbol}
valid := (valid or is_ok(next, curr, next, i-1));
end
else
begin
state := 0;
if (valid) then
sum := sum + number;
end;
end;
end;
end;
{ main loop }
while not eof(file_) do
begin
state := 0;
prev := curr;
curr := next;
readln(file_, next);
writeln();
writeln(prev);
writeln(curr);
writeln(next);
for i := 1 to LINE_LENGTH do
begin
c := curr[i];
case state of
{waiting for number}
0:
begin
{number}
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, number);
valid := false;
state := 1;
valid := (valid or is_ok(prev, curr, next, i-1));
end;
end;
{reading number and checking true}
1:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
{look for symbol}
valid := (valid or is_ok(prev, curr, next, i-1));
end
else
begin
state := 0;
if (valid) then
sum := sum + number;
end;
end;
end;
write(state);
end;
if (state = 1) then
begin
begin
if (valid) then
sum := sum + number;
end;
end;
end;
state := 0;
prev := curr;
curr := next;
for i := 1 to LINE_LENGTH do
begin
c := curr[i];
case state of
{waiting for number}
0:
begin
{number}
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, number);
valid := false;
state := 1;
valid := (valid or is_ok(prev, curr, prev, i-1));
end;
end;
{reading number and checking true}
1:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
{look for symbol}
valid := (valid or is_ok(prev, curr, prev, i-1));
end
else
begin
state := 0;
if (valid) then
sum := sum + number;
end;
end;
end;
end;
writeln();
writeln(sum);
end.

View File

@@ -0,0 +1,224 @@
program day3part2;
uses sysutils;
var
file_: text;
curr: string;
sum, game: int32;
state: int32;
number: int32;
valid: boolean;
i, a, b: int32;
line: int32;
c: char;
LINE_LENGTH: int32 = 140;
curr_asterisk: int32;
asterisks: int32;
asterisk_values: array[1..1000] of int32;
asterisk_locations: array[1..1000, 1..2] of int32;
function is_symbol(str: string; ind: int32): boolean;
begin
is_symbol := (str[ind] = '*')
end;
function find_asterisk(hpos: int32; vpos: int32): int32;
var
j: int32;
begin
find_asterisk := -1;
for j := 1 to asterisks do
begin
if ((asterisk_locations[j, 1] = hpos) and (asterisk_locations[j, 2] = vpos)) then
begin
find_asterisk := j;
break;
end;
end;
end;
function get_asterisk_id(hpos: int32; vpos: int32): int32;
var
fucked_up: int32;
begin
get_asterisk_id := -1;
fucked_up := find_asterisk(hpos-1, vpos-1);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
fucked_up := find_asterisk(hpos, vpos-1);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
fucked_up := find_asterisk(hpos+1, vpos-1);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
fucked_up := find_asterisk(hpos-1, vpos);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
fucked_up := find_asterisk(hpos+1, vpos);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
fucked_up := find_asterisk(hpos-1, vpos+1);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
fucked_up := find_asterisk(hpos, vpos+1);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
fucked_up := find_asterisk(hpos+1, vpos+1);
if (fucked_up <> -1) then
get_asterisk_id := fucked_up;
end;
(* Here the main program block starts *)
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day3.txt');
reset(file_);
{ initialize sum and count to 0 }
sum := 0;
{ read the first two lines }
line := 1;
asterisks := 0;
{find the position of all asterisks}
while not eof(file_) do
begin
readln(file_, curr);
for i := 1 to LINE_LENGTH do
begin
if is_symbol(curr, i) then
begin
asterisk_locations[asterisks + 1][1] := i;
asterisk_locations[asterisks + 1][2] := line;
asterisk_values[asterisks + 1] := 0;
asterisks := asterisks + 1;
end;
end;
line := line + 1;
end;
line := 0;
reset(file_);
writeln('boobs');
{ main loop }
while not eof(file_) do
begin
state := 0;
line := line + 1;
readln(file_, curr);
for i := 1 to LINE_LENGTH do
begin
c := curr[i];
write(c);
case state of
{waiting for number}
0:
begin
{number}
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, number);
state := 1;
curr_asterisk := get_asterisk_id(i, line);
end;
end;
{reading number and checking true}
1:
begin
if (('0' <= c) and (c <= '9')) then
begin
writeln('boobs2');
{add number to number}
val(c, b);
number := number * 10 + b;
{look for symbol}
b := get_asterisk_id(i, line);
if (b <> -1) then
curr_asterisk := b;
end
else
begin
state := 0;
writeln(curr_asterisk);
if (curr_asterisk <> -1) then
begin
if (asterisk_values[curr_asterisk] = 0) then
asterisk_values[curr_asterisk] := number
else if (asterisk_values[curr_asterisk] > 0) then
begin
sum := sum + asterisk_values[curr_asterisk] * number;
asterisk_values[curr_asterisk] := -1;
end;
end;
end;
end;
end;
write(state);
end;
if (state = 1) then
begin
begin
if (curr_asterisk <> -1) then
begin
if (asterisk_values[curr_asterisk] = 0) then
asterisk_values[curr_asterisk] := number
else if (asterisk_values[curr_asterisk] > 0) then
begin
sum := sum + asterisk_values[curr_asterisk] * number;
asterisk_values[curr_asterisk] := -1;
end;
end;
end;
end;
end;
i := get_asterisk_id(114, 126);
writeln(i);
writeln(asterisk_locations[i, 1]);
writeln(asterisk_locations[i, 2]);
writeln(sum);
end.

View File

@@ -0,0 +1,141 @@
program day4part1;
uses sysutils;
type
MState = (ToColon, WasteSpace, ReadWin, WasteSpace2, ReadHave);
var
state: MState;
file_: text;
str: string;
number: int32;
winning: array[1..100] of int32;
have: array[1..100] of int32;
winning_length, have_length: int32;
b, d: int32;
c: char;
i, j: int32;
scores: array[0..10] of int32 = (0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512);
sum: int32;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day4.txt');
reset(file_);
sum := 0;
while not EOF(file_) do
begin
{ state of current searching }
state := ToColon;
{ read in a file}
readln(file_, str);
fillchar(have[1], sizeof(have), 0);
fillchar(winning[1], sizeof(winning), 0);
for c in str do
begin
{ holy case statement. }
case state of
ToColon:
begin
if (c = ':') then
state := WasteSpace
end;
WasteSpace:
begin
state := ReadWin;
number := 0;
winning_length := 1;
end;
ReadWin:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
winning[winning_length] := number;
winning_length := winning_length + 1;
number := 0;
end
else if (c = '|') then
begin
state := WasteSpace2;
number := 0;
end;
end;
WasteSpace2:
begin
state := ReadHave;
number := 0;
have_length := 1;
end;
ReadHave:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
have[have_length] := number;
have_length := have_length + 1;
number := 0;
end
else if (c = '|') then
begin
state := WasteSpace2;
number := 0;
end;
end;
end;
end;
have[have_length] := number;
have_length := have_length + 1;
d := 0;
for i in winning do
begin
if (i = 0) then
begin
continue;
end;
for j in have do
begin
if (j = 0) then
begin
continue;
end;
if (i = j) then
d := d + 1
end;
end;
sum := sum + scores[d];
end;
writeln(sum);
end.

View File

@@ -0,0 +1,154 @@
program day4part2;
uses sysutils;
type
MState = (ToColon, WasteSpace, ReadWin, WasteSpace2, ReadHave);
var
state: MState;
file_: text;
str: string;
number: int32;
cardnum: int32;
winning: array[1..100] of int32;
have: array[1..100] of int32;
copies: array[1..1000] of int32;
winning_length, have_length: int32;
b, d: int32;
c: char;
i, j: int32;
sum: int32;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day4.txt');
reset(file_);
filldword(copies, length(copies), 1);
sum := 0;
cardnum := 0;
while not EOF(file_) do
begin
cardnum := cardnum + 1;
{ state of current searching }
state := ToColon;
{ read in a file}
readln(file_, str);
fillchar(have[1], sizeof(have), 0);
fillchar(winning[1], sizeof(winning), 0);
for c in str do
begin
{ holy case statement. }
case state of
ToColon:
begin
if (c = ':') then
state := WasteSpace
end;
WasteSpace:
begin
state := ReadWin;
number := 0;
winning_length := 1;
end;
ReadWin:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
winning[winning_length] := number;
winning_length := winning_length + 1;
number := 0;
end
else if (c = '|') then
begin
state := WasteSpace2;
number := 0;
end;
end;
WasteSpace2:
begin
state := ReadHave;
number := 0;
have_length := 1;
end;
ReadHave:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
have[have_length] := number;
have_length := have_length + 1;
number := 0;
end
else if (c = '|') then
begin
state := WasteSpace2;
number := 0;
end;
end;
end;
end;
have[have_length] := number;
have_length := have_length + 1;
d := 0;
for i in winning do
begin
if (i = 0) then
begin
continue;
end;
for j in have do
begin
if (j = 0) then
begin
continue;
end;
if (i = j) then
d := d + 1
end;
end;
for i := 1 to d do
begin
copies[cardnum + i] := copies[cardnum + i] + copies[cardnum];
end;
end;
for i := 1 to cardnum do
begin
sum := sum + copies[i];
end;
writeln(sum);
end.

View File

@@ -0,0 +1,163 @@
program day5part1;
uses sysutils;
type
SState = (ToColon, WasteSpace, ReadSeeds, NewLine);
MState = (Seed, WaitMap, ReadMap);
var
seeds: array[1..20] of int64;
next_seeds: array[1..20] of int64;
map: array[1..3] of int64;
seed_length: int64;
cmap: int64;
seed_state: SState;
state: MState;
file_: text;
str: string;
number: int64;
c: char;
i, j, b: int64;
srange, erange: int64;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day5.txt');
reset(file_);
state := Seed;
while not EOF(file_) do
begin
{ read in a file}
readln(file_, str);
case state of
Seed:
begin
seed_state := ToColon;
for c in str do
begin
case seed_state of
ToColon:
begin
if (c = ':') then
seed_state := WasteSpace
end;
WasteSpace:
begin
seed_state := ReadSeeds;
number := 0;
seed_length := 0;
end;
ReadSeeds:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
seed_length := seed_length + 1;
seeds[seed_length] := number;
number := 0;
end
end;
end;
end;
seed_length := seed_length + 1;
seeds[seed_length] := number;
fillqword(next_seeds, length(next_seeds), 18446744073709551615);
state := WaitMap;
end;
WaitMap:
if (length(str) > 0) then
begin
state := ReadMap;
{ change this later because this is wrong }
for i := 0 to length(seeds) do
begin
if (next_seeds[i] <> -1) then
seeds[i] := next_seeds[i]
end;
{ this is -1 }
fillqword(next_seeds, length(next_seeds), 18446744073709551615);
writeln('break');
end;
ReadMap:
begin
if (length(str) = 0) then
begin
state := WaitMap;
continue;
end;
cmap := 0;
number := 0;
for c in str do
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
cmap := cmap + 1;
map[cmap] := number;
number := 0;
end;
end;
cmap := cmap + 1;
map[cmap] := number;
srange := map[2];
erange := map[2] + map[3] - 1;
for i := 1 to length(seeds) do
begin
if ((seeds[i] >= srange) and (seeds[i] <= erange)) then
begin
next_seeds[i] := seeds[i] - srange + map[1];
end;
end;
writeln();
for i in next_seeds do
writeln(i);
end;
end;
end;
writeln();
for i := 0 to length(seeds) do
begin
if (next_seeds[i] <> -1) then
seeds[i] := next_seeds[i]
end;
for i in seeds do
writeln(i);
end.

View File

@@ -0,0 +1,272 @@
program day5part1;
uses sysutils;
type
SState = (ToColon, WasteSpace, ReadSeeds, NewLine);
MState = (Seed, WaitMap, ReadMap, Q);
var
seeds: array[1..100000] of int64;
next_seeds: array[1..100000] of int64;
map: array[1..3] of int64;
seed_length: int64;
cmap: int64;
seed_state: SState;
state: MState;
file_: text;
str: string;
number: int64;
c: char;
i, b: int64;
srange, erange: int64;
sseed, eseed: int64;
times: int64;
procedure add_seed(a: int64; b: int64);
begin
seeds[seed_length + 1] := a;
seeds[seed_length + 2] := b - a + 1;
seed_length := seed_length + 2;
end;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day5.txt');
reset(file_);
times := 0;
state := Seed;
while not EOF(file_) do
begin
{ read in a file}
readln(file_, str);
case state of
Seed:
begin
seed_state := ToColon;
for c in str do
begin
case seed_state of
ToColon:
begin
if (c = ':') then
seed_state := WasteSpace
end;
WasteSpace:
begin
seed_state := ReadSeeds;
number := 0;
seed_length := 0;
end;
ReadSeeds:
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
seed_length := seed_length + 1;
seeds[seed_length] := number;
number := 0;
end
end;
end;
end;
seed_length := seed_length + 1;
seeds[seed_length] := number;
fillqword(next_seeds, length(next_seeds), 18446744073709551615);
state := WaitMap;
end;
WaitMap:
if (length(str) > 0) then
begin
state := ReadMap;
{ change this later because this is wrong }
for i := 0 to length(seeds) do
begin
if (next_seeds[i] <> -1) then
seeds[i] := next_seeds[i]
end;
{ this is -1 }
fillqword(next_seeds, length(next_seeds), 18446744073709551615);
writeln('break');
for i := 1 to seed_length do
begin
write(seeds[i]);
write(' ');
end;
writeln();
end;
ReadMap:
begin
if (length(str) = 0) then
begin
state := WaitMap;
continue;
end;
cmap := 0;
number := 0;
for c in str do
begin
if (('0' <= c) and (c <= '9')) then
begin
{add number to number}
val(c, b);
number := number * 10 + b;
end
else if (c = ' ') then
begin
cmap := cmap + 1;
map[cmap] := number;
number := 0;
end;
end;
cmap := cmap + 1;
map[cmap] := number;
srange := map[2];
erange := map[2] + map[3] - 1;
write('here we go: ');
writeln(times);
for i := 1 to length(seeds) do
begin
if ((i and 1) = 0) then
continue;
if (seeds[i + 1] = 0) then
continue;
if (i >= seed_length) then
break;
writeln(i);
sseed := seeds[i];
eseed := seeds[i] + seeds[i + 1] - 1;
write(sseed);
write(' ');
writeln(eseed);
srange := map[2];
erange := map[2] + map[3] - 1;
write(srange);
write(' ');
writeln(erange);
{ range contained }
if ((eseed > erange) and (sseed < srange)) then
begin
writeln('range contained');
{ add the right tail }
add_seed(erange + 1, eseed);
{ add the left tail }
add_seed(sseed, srange - 1);
next_seeds[i + 1] := erange - srange;
next_seeds[i] := map[1];
seeds[i + 1] := 0;
end
{ left tailed }
else if ((eseed > erange) and (erange >= sseed)) then
begin
writeln('left');
{ add the right tail}
add_seed(erange + 1, eseed);
{ update length }
next_seeds[i + 1] := erange - sseed + 1;
{ adjust according to map }
next_seeds[i] := map[1] + sseed - srange;
seeds[i + 1] := 0;
end
{ right tailed }
else if ((eseed >= srange) and (srange > sseed)) then
begin
writeln('right');
{ add the left tail}
add_seed(sseed, srange - 1);
{ update length }
next_seeds[i + 1] := eseed - srange + 1;
{ adjust according to map }
next_seeds[i] := map[1];
seeds[i + 1] := 0;
end
else if ((srange <= sseed) and (eseed <= erange)) then
begin
writeln('easy mode');
next_seeds[i] := map[1] + sseed - srange;
end
else
begin
writeln('GOD FUCKING DAMMIT');
end;
end;
writeln();
for i := 1 to seed_length do
begin
write(next_seeds[i]);
write(' ');
end;
writeln();
for i := 1 to seed_length do
begin
write(seeds[i]);
write(' ');
end;
writeln();
writeln(seed_length);
writeln('next');
times := times + 1;
{ if (times = 6) then
break;}
end;
end;
end;
writeln();
for i := 0 to length(seeds) do
begin
if (next_seeds[i] <> -1) then
seeds[i] := next_seeds[i]
end;
for i := 1 to seed_length do
begin;
if ((i and 1) = 0) then
continue;
writeln(seeds[i]);
end;
end.

View File

@@ -0,0 +1,35 @@
program day5part1;
uses sysutils;
type
SState = (ToColon, WasteSpace, ReadSeeds, NewLine);
MState = (Seed, WaitMap, ReadMap);
var
race_times: array of int32 = (57, 72, 69, 92);
race_distances: array of int32 = (291, 1172, 1176, 2026);
valid: array of int32 = (0, 0, 0, 0);
i, j: int32;
begin
for i := 0 to 3 do
begin
writeln(race_times[i]);
writeln(race_distances[i]);
for j := 1 to race_times[i] do
begin
if (race_times[i] - j) * j > race_distances[i] then
valid[i] := valid[i] + 1
end;
end;
writeln(valid[0] * valid[1] * valid[2] * valid[3])
end.

View File

@@ -0,0 +1,32 @@
program day5part1;
uses sysutils;
type
SState = (ToColon, WasteSpace, ReadSeeds, NewLine);
MState = (Seed, WaitMap, ReadMap);
var
race_time: int64 = 57726992;
race_distance: int64 = 291117211762026;
valid: int64 = 0;
i, j: int32;
begin
writeln(race_time);
writeln(race_distance);
for j := 1 to race_time do
begin
if (race_time - j) * j > race_distance then
valid := valid + 1
end;
writeln(valid);
end.

View File

@@ -0,0 +1,188 @@
program day5part1;
uses sysutils;
type
MState = (ReadCards, ReadBet);
var
state: MState;
file_: text;
c: char;
i, j, b: int64;
sum, count: int32;
rank: array[1..1000] of int32;
bet: array[1..1000] of int32;
line: string;
function CardToValue(inp: char): int32;
begin
case inp of
'A': CardToValue := 12;
'K': CardToValue := 11;
'Q': CardToValue := 10;
'J': CardToValue := 9;
'T': CardToValue := 8;
'9': CardToValue := 7;
'8': CardToValue := 6;
'7': CardToValue := 5;
'6': CardToValue := 4;
'5': CardToValue := 3;
'4': CardToValue := 2;
'3': CardToValue := 1;
'2': CardToValue := 0;
end;
end;
function HandToValue(inp: string): int32;
var
c: char;
type_, hand_value: int32;
counts: array[0..12] of int32;
duos, trips, quads, quints: int32;
i: int32;
begin
filldword(counts, length(counts), 0);
for c in inp do
counts[CardToValue(c)] := counts[CardToValue(c)] + 1;
duos := 0;
trips := 0;
quads := 0;
quints := 0;
for i in counts do
begin
if (i = 2) then
duos := duos + 1
else if (i = 3) then
trips := trips + 1
else if (i = 4) then
quads := quads + 1
else if (i = 5) then
quints := quints + 1
end;
{5K, 4K, FH, 3K, 2P, 1P, HC}
{ 7, 6, 5, 4, 3, 2, 1}
if (quints = 1) then
type_ := 7
else if (quads = 1) then
type_ := 6
else if ((trips = 1) and (duos = 1)) then
type_ := 5
else if (trips = 1) then
type_ := 4
else if (duos = 2) then
type_ := 3
else if (duos = 1) then
type_ := 2
else
type_ := 1;
hand_value := CardToValue(inp[1]) * 28561 + CardToValue(inp[2]) * 2197 + CardToValue(inp[3]) * 169 + CardToValue(inp[4]) * 13 + CardToValue(inp[5]);
HandToValue := 371293 * type_ + hand_value;
end;
procedure DoubleSort(var arr1: array of int32; var arr2: array of int32; l: int32);
var
i, t: int32;
swapped: boolean;
begin
while (true) do
begin
swapped := false;
for i := 1 to l-1 do
begin
if (arr1[i-1] > arr1[i]) then
begin
t := arr1[i-1];
arr1[i-1] := arr1[i];
arr1[i] := t;
t := arr2[i-1];
arr2[i-1] := arr2[i];
arr2[i] := t;
swapped := true;
end;
end;
if (not swapped) then
break;
end
end;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day7.txt');
reset(file_);
count := 0;
while not EOF(file_) do
begin
count := count + 1;
readln(file_, line);
writeln(count);
writeln(line);
rank[count] := HandToValue(copy(line, 1, 5));
val(copy(line, 6, length(line) - 5), bet[count]);
write(rank[count]);
write(' ');
writeln(bet[count]);
end;
writeln('a');
for i := 1 to count do
writeln(rank[i]);
writeln();
doublesort(rank, bet, count);
writeln(rank[count]);
writeln(bet[count]);
sum := 0;
writeln('a');
for i := 1 to count do
writeln(rank[i]);
writeln();
for i := 1 to count do
sum := sum + bet[i] * i;
writeln(sum);
end.

View File

@@ -0,0 +1,199 @@
program day5part1;
uses sysutils;
type
MState = (ReadCards, ReadBet);
var
state: MState;
file_: text;
c: char;
i, j, b: int64;
sum, count: int32;
rank: array[1..1000] of int32;
bet: array[1..1000] of int32;
line: string;
function CardToValue(inp: char): int32;
begin
case inp of
'A': CardToValue := 12;
'K': CardToValue := 11;
'Q': CardToValue := 10;
'T': CardToValue := 9;
'9': CardToValue := 8;
'8': CardToValue := 7;
'7': CardToValue := 6;
'6': CardToValue := 5;
'5': CardToValue := 4;
'4': CardToValue := 3;
'3': CardToValue := 2;
'2': CardToValue := 1;
'J': CardToValue := 0;
end;
end;
function HandToValue(inp: string): int32;
var
c: char;
type_, hand_value: int32;
counts: array[0..12] of int32;
duos, trips, quads, quints: int32;
jokes: int32;
i: int32;
begin
filldword(counts, length(counts), 0);
for c in inp do
counts[CardToValue(c)] := counts[CardToValue(c)] + 1;
duos := 0;
trips := 0;
quads := 0;
quints := 0;
jokes := counts[0];
{ reset jokes so that they won't be counted}
counts[0] := 0;
for i in counts do
begin
if (i + jokes = 2) then
duos := duos + 1
else if (i + jokes = 3) then
trips := trips + 1
else if (i + jokes = 4) then
quads := quads + 1
else if (i + jokes = 5) then
quints := quints + 1
end;
{5K, 4K, FH, 3K, 2P, 1P, HC}
{ 7, 6, 5, 4, 3, 2, 1}
if ((quints = 1) or (jokes = 5)) then
type_ := 7
else if (quads >= 1) then
type_ := 6
else if ((trips = 1) and (duos = 1)) or (trips = 2) then
type_ := 5
else if (trips >= 1) then
type_ := 4
else if (duos = 2) then
type_ := 3
else if (duos >= 1) then
type_ := 2
else
type_ := 1;
writeln(inp);
writeln(type_);
hand_value := CardToValue(inp[1]) * 28561 + CardToValue(inp[2]) * 2197 + CardToValue(inp[3]) * 169 + CardToValue(inp[4]) * 13 + CardToValue(inp[5]);
writeln(hand_value);
HandToValue := 371293 * type_ + hand_value;
end;
procedure DoubleSort(var arr1: array of int32; var arr2: array of int32; l: int32);
var
i, t: int32;
swapped: boolean;
begin
while (true) do
begin
swapped := false;
for i := 1 to l-1 do
begin
if (arr1[i-1] > arr1[i]) then
begin
t := arr1[i-1];
arr1[i-1] := arr1[i];
arr1[i] := t;
t := arr2[i-1];
arr2[i-1] := arr2[i];
arr2[i] := t;
swapped := true;
end;
end;
if (not swapped) then
break;
end
end;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day7.txt');
reset(file_);
count := 0;
while not EOF(file_) do
begin
count := count + 1;
readln(file_, line);
writeln(count);
writeln(line);
rank[count] := HandToValue(copy(line, 1, 5));
val(copy(line, 6, length(line) - 5), bet[count]);
write(rank[count]);
write(' ');
writeln(bet[count]);
end;
writeln('a');
for i := 1 to count do
writeln(rank[i]);
writeln();
doublesort(rank, bet, count);
writeln(rank[count]);
writeln(bet[count]);
sum := 0;
writeln('a');
for i := 1 to count do
writeln(rank[i]);
writeln();
for i := 1 to count do
sum := sum + bet[i] * i;
writeln(sum);
end.

View File

@@ -0,0 +1,82 @@
program day8part1;
uses sysutils;
type
MState = (ReadCards, ReadBet);
var
file_: text;
instructions: AnsiString;
str: string;
count: int32;
steps: int32;
step: char;
i: int32;
{ node, left, right }
nodes: array[0..1000, 0..2] of string;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day8.txt');
reset(file_);
{ read instructions }
readln(file_, instructions);
{ read empty line }
readln(file_, str);
count := 0;
{ read nodes }
while not EOF(file_) do
begin
readln(file_, str);
{ start }
nodes[count, 0] := copy(str, 1, 3);
{ left }
nodes[count, 1] := copy(str, 8, 3);
{ right }
nodes[count, 2] := copy(str, 13, 3);
count := count + 1;
end;
{ start at AAA }
steps := 0;
str := 'AAA';
{ until we reach the end }
while CompareText(str, 'ZZZ') <> 0 do
begin
{ get step }
step := instructions[(steps mod length(instructions)) + 1];
steps := steps + 1;
{ find node }
for i := 0 to count do
begin
if CompareText(nodes[i, 0], str) = 0 then
break
end;
{ go to next node}
case step of
'L': str := nodes[i, 1];
'R': str := nodes[i, 2];
end;
end;
writeln(steps);
end.

View File

@@ -0,0 +1,184 @@
program day8part2;
uses sysutils;
var
file_: text;
instructions: AnsiString;
str: string;
count: int32;
steps: int32;
step: char;
i, j: int32;
{ node, left, right }
nodes: array[0..1000, 0..2] of string;
prev_states: array[0..100000] of string;
prev_ics: array[0..100000] of int32;
prev_count: int32;
b: array[0..1000] of int32;
l: array[0..1000] of int32;
a: array[0..1000, 0..1000] of int32;
a_count: array[0..1000] of int32;
current_nodes: array[0..1000] of string;
current_nodes_count: int32;
finished: boolean;
begin
{ open inp.txt for reading }
assign(file_, 'resources/2023/day8.txt');
reset(file_);
{ read instructions }
readln(file_, instructions);
{ read empty line }
readln(file_, str);
count := 0;
{ read nodes }
while not EOF(file_) do
begin
readln(file_, str);
{ start }
nodes[count, 0] := copy(str, 1, 3);
{ left }
nodes[count, 1] := copy(str, 8, 3);
{ right }
nodes[count, 2] := copy(str, 13, 3);
count := count + 1;
end;
current_nodes_count := 0;
{ find all nodes that end with A }
for i := 0 to count - 1 do
begin
{ if ends with A }
if nodes[i, 0][3] = 'A' then
begin
{ adds it to current nodes }
current_nodes[current_nodes_count] := nodes[i, 0];
current_nodes_count := current_nodes_count + 1;
end;
end;
{ for each node }
for j := 0 to current_nodes_count - 1 do
begin
steps := 0;
prev_count := 0;
finished := False;
writeln(current_nodes[j]);
while not finished do
begin
{ add state }
prev_states[prev_count] := current_nodes[j];
prev_ics[prev_count] := (steps mod length(instructions)) + 1;
{ get step }
step := instructions[(steps mod length(instructions)) + 1];
steps := steps + 1;
{ find node }
for i := 0 to count do
begin
if CompareText(nodes[i, 0], current_nodes[j]) = 0 then
break
end;
{ go to next node }
case step of
'L': current_nodes[j] := nodes[i, 1];
'R': current_nodes[j] := nodes[i, 2];
end;
{ check if next node is in previous state }
for i := 0 to prev_count do
begin
if (prev_states[i] = current_nodes[j]) and (prev_ics[i] = (steps mod length(instructions)) + 1) then
begin
finished := true;
break;
end;
end;
prev_count := prev_count + 1;
end;
{ offset to start of loop }
write('b = ');
b[j] := i - 1;
writeln(b[j]);
{ length of loop }
write('l = ');
l[j] := prev_count - i;
writeln(l[j]);
{ find offsets to the loop where it's finished }
a_count[j] := 0;
for i := b[j] to prev_count - 1 do
begin
{ i'm sure this will cause no problems }
if i < 0 then
continue;
{ if this is a finished state }
if prev_states[i][3] = 'Z' then
begin
{ add it to the a list }
a[j, a_count[j]] := i - b[j];
write('a_');
write(a_count[j]);
write(' = ');
writeln(a[j, a_count[j]]);
a_count[j] := a_count[j] + 1;
end;
end;
// O( n * (l + b))
// l is length of loop
// b is length of leadup
// n is number of nodes
// O(a^n)
// a is number of finished states
{
i might come back to this to actually do this i'm tired rn
}
end;
end.

View File

@@ -0,0 +1,514 @@
const
UINT32MAX: uint64 = $00000000FFFFFFFF;
type
int512 = record
{ 16 32 bit values in 64 bit ints }
values: array[0..15] of int64;
end;
operator := (n: int64) b: int512;
begin
if n >= 0 then
fillqword(b.values, 16, 0)
else
fillqword(b.values, 16, UINT32MAX);
b.values[0] := n and UINT32MAX;
b.values[1] := n shr 32;
end;
procedure print512(n: int512; printall: boolean = false);
var
i: int32;
started: boolean;
begin
started := printall;
for i := 0 to 15 do
begin
if (n.values[15 - i] <> 0) or started or (i = 15) then
begin
write(hexstr(n.values[15 - i], 8));
if (i <> 15) then
write(' ');
started := true;
end;
end;
end;
procedure print512f(n: int512; printall: boolean = false);
var
i: int32;
started: boolean;
begin
started := printall;
for i := 0 to 15 do
begin
if (n.values[15 - i] <> 0) or started or (i = 15) then
begin
write(hexstr(n.values[15 - i], 16));
if (i <> 15) then
write(' ');
started := true;
end;
end;
end;
function isneg(n: int512): boolean;
begin
isneg := (n.values[15] and (1 shl 31)) <> 0
end;
function bigshiftleft(n: int512; b: int32): int512;
var
i: int32;
begin
bigshiftleft := 0;
for i := 0 to 15 - b do
begin
bigshiftleft.values[i + b] := n.values[i];
end;
end;
function bigshiftright(n: int512; b: int32): int512;
var
i: int32;
begin
bigshiftright := 0;
for i := 0 to 15 - b do
begin
bigshiftright.values[i] := n.values[i + b];
end;
end;
operator shl (a: int512; b: int32) o: int512;
var
i: int32;
begin
a := bigshiftleft(a, (b and (not 31)) shr 5);
{ handle first seperately }
o.values[0] := (a.values[0] shl (b and 31)) and UINT32MAX;
for i := 1 to 15 do
begin
o.values[i] := (((a.values[i - 1] shl (b and 31)) shr 32) or // leftover from behind cell
((a.values[i] shl (b and 31)))) and UINT32MAX; // from this cell
end;
end;
operator shr (a: int512; b: int32) o: int512;
var
i: int32;
begin
a := bigshiftright(a, (b and (not 31)) shr 5);
{
00001234 00005678 00001234
12340000 56780000 12340000
00000012 00003456 00007812
}
for i := 0 to 14 do
begin
o.values[i] := (((a.values[i + 1] shl (32 - (b and 31))) and UINT32MAX) or // from previous cell
(a.values[i] shr (b and 31))) // from this cell
end;
{ handle last seperately }
o.values[15] := a.values[15] shr (b and 31);
end;
operator + (a, b: int512) out_: int512;
var
i: int32;
t: int64;
carry: int32;
begin
carry := 0;
for i := 0 to 15 do
begin
t := a.values[i] + b.values[i] + carry;
carry := 0;
if t > UINT32MAX then
begin
carry := t shr 32;
t := t and UINT32MAX;
end;
out_.values[i] := t;
end;
end;
operator - (a: int512) out_: int512;
var
i: int32;
begin
for i := 0 to 15 do
begin
a.values[i] := a.values[i] xor UINT32MAX;
end;
out_ := a + 1;
end;
operator - (a, b: int512) out_: int512;
begin
out_ := a + (- b);
end;
operator > (a, b: int512) out_: boolean;
var
i: int32;
begin
out_ := false;
for i := 0 to 15 do
begin
if (a.values[15 - i] > b.values[15 - i]) then
begin
out_ := true;
break;
end
else if (a.values[15 - i] = b.values[15 - i]) then
continue
else
break
end;
end;
operator < (a, b: int512) out_: boolean;
var
i: int32;
begin
out_ := false;
for i := 0 to 15 do
begin
if (a.values[15 - i] < b.values[15 - i]) then
begin
out_ := true;
break;
end
else if (a.values[15 - i] = b.values[15 - i]) then
continue
else
break
end;
end;
operator >= (a, b: int512) out_: boolean;
begin
out_ := not (a < b);
end;
operator <= (a, b: int512) out_: boolean;
begin
out_ := not (a > b);
end;
operator = (a, b: int512) out_: boolean;
var
i: int32;
begin
out_ := true;
for i := 0 to 15 do
begin
if (a.values[15 - i] = b.values[15 - i]) then
continue
else
begin
out_ := false;
break;
end;
end;
end;
operator <> (a, b: int512) out_: boolean;
begin
out_ := not (a = b);
end;
operator * (a, b: int512) out_: int512;
var
i, j: int32;
t: uint64;
carry: int512;
neg: boolean;
begin
neg := false;
if isneg(a) then
begin
neg := not neg;
a := -a;
end;
if isneg(b) then
begin
neg := not neg;
b := -b;
end;
carry := 0;
out_ := 0;
for i := 0 to 15 do
begin
for j := 0 to 15 do
begin
if (i + j > 15) then
continue;
t := a.values[i] * b.values[j];
if t > UINT32MAX then
begin
carry.values[i + j + 1] := carry.values[i + j + 1] + (t shr 32);
t := t and UINT32MAX;
end;
out_.values[i + j] := out_.values[i + j] + t;
end;
end;
out_ := carry + out_;
if neg then
out_ := -out_;
end;
operator mod (a, b: int512) out_: int512;
var
i: int32;
normalize_factor: int32;
begin
{ normalize divisor }
{ big normalize }
for i := 0 to 15 do
begin
if b.values[15 - i] <> 0 then
begin
normalize_factor := i * 32;
b := bigshiftleft(b, i);
break;
end;
end;
{ small normalize }
for i := 0 to 31 do
begin
if (b.values[15] and (1 shl (31 - i))) <> 0 then
begin
normalize_factor := normalize_factor + i;
b := b shl i;
break;
end;
end;
{subtract}
for i := 0 to (normalize_factor) do
begin
if a >= b then
begin
//print512f(a);
//write('a ');
//print512f(b);
//write('b ');
//writeln();
a := a - b;
// only necessary for true division
// out_ := out_ + 1;
// out_ := out_ shl 1;
end;
b := b shr 1;
end;
out_ := a;
end;
operator div (a, b: int512) out_: int512;
var
i: int32;
normalize_factor: int32;
neg: boolean;
begin
neg := false;
if isneg(a) then
begin
neg := not neg;
a := -a;
end;
if isneg(b) then
begin
neg := not neg;
b := -b;
end;
{ normalize divisor }
{ big normalize }
for i := 0 to 15 do
begin
if b.values[15 - i] <> 0 then
begin
normalize_factor := i * 32;
b := bigshiftleft(b, i);
break;
end;
end;
{ small normalize }
for i := 0 to 31 do
begin
if (b.values[15] and (1 shl (31 - i))) <> 0 then
begin
normalize_factor := normalize_factor + i;
b := b shl i;
break;
end;
end;
{subtract}
out_ := 0;
for i := 0 to (normalize_factor) do
begin
out_ := out_ shl 1;
if a >= b then
begin
{print512f(a);
write('a ');
print512f(b);
write('b ');
print512f(out_);
write('o ');
print512f(out_ shl 1);
writeln('o ');}
a := a - b;
out_ := out_ + 1;
end;
b := b shr 1;
end;
if neg then
out_ := -out_;
end;
procedure print512d(n: int512);
var
c: array[0..1000] of char;
count: int32;
q: int32;
begin
if isneg(n) then
begin
write('-');
n := -n;
end;
if n = 0 then
write('0')
else
begin
count := 0;
while n <> 0 do
begin
c[count] := chr(byte((n mod 10).values[0]) + 48);
n := n div 10;
count := count + 1;
end;
for q := 1 to count do
begin
write(c[count - q]);
end;
end;
end;
function abs(n: int512): int512;
begin
abs := n;
if isneg(n) then
abs := -n;
end;
function power(n: int512; m: int32): int512;
var
i: int32;
begin
power := 1;
for i := 1 to m do
begin
power := power * n;
end;
end;
// testing
{
var
a, b, c: int512;
begin
b := $1111;
a := $FFFFFFFFFFFFFFFF;
c := $3000000000000003;
a := a shl 72 + 1;
print512(a);
writeln();
print512(b);
writeln();
print512(a div b);
// 0f000f00 0f000f00 00000000 00000000
end.
}

View File

@@ -0,0 +1,131 @@
{$include bigint.pas}
type
fraction = record
numerator: int512;
denominator: int512;
end;
const
{ i don't think there's a better way of doing this unfortunately }
SIMPLIFY_CUTOFF: int512 = (
values: ($00000000FFFFFFFF, $00000000FFFFFFFF, $00000000FFFFFFFF, $00000000FFFFFFFF, $00000000FFFFFFFF, $00000000FFFFFFFF, $00000000FFFFFFFF, $0000000000000000,
$0000000000000000, $0000000000000000, $0000000000000000, $0000000000000000, $0000000000000000, $0000000000000000, $0000000000000000, $0000000000000000);
);
procedure print_fraction(a: fraction);
begin
if a.denominator <> 1 then
begin
print512d(a.numerator);
write('/');
print512d(a.denominator);
end
else
print512d(a.numerator);
end;
function c_fraction(num: int512; den: int512): fraction;
begin
if den = 0 then
writeln('holy hell what are you doing');
c_fraction.numerator := num;
c_fraction.denominator := den;
end;
operator := (f: int64) out_ : fraction;
begin
out_ := c_fraction(f, 1);
end;
function gcd(a, b: int512): int512;
var
r: int512;
begin
while true do
begin
r := a mod b;
if r = 0 then
break;
a := b;
b := r;
end;
gcd := b;
end;
function simplify(f: fraction): fraction;
var
b: int512;
neg: boolean;
begin
neg := false;
if isneg(f.numerator) then
begin
neg := not neg;
f.numerator := -f.numerator;
end;
if isneg(f.denominator) then
begin
neg := not neg;
f.denominator := -f.denominator;
end;
b := gcd(f.numerator, f.denominator);
if b <> 0 then
simplify := c_fraction(f.numerator div b, f.denominator div b)
else
simplify := f;
if neg then
simplify.numerator := -simplify.numerator;
end;
{ add fractions }
operator + (a, b: fraction) out_: fraction;
//var
// g: int512;
begin
// print_fraction(a);
// write(' ');
// print_fraction(b);
// write(' ');
// g := gcd(a.denominator, b.denominator);
out_.denominator := a.denominator * b.denominator;
out_.numerator := a.denominator * b.numerator + b.denominator * a.numerator;
// print_fraction(out_);
// write(' ');
if abs(out_.numerator) > SIMPLIFY_CUTOFF then
out_ := simplify(out_);
// print_fraction(out_);
// writeln('ya');
end;
{ mult fractions }
operator * (a, b: fraction) out_: fraction;
begin
out_.denominator := a.denominator * b.denominator;
out_.numerator := a.numerator * b.numerator;
if abs(out_.numerator) > SIMPLIFY_CUTOFF then
out_ := simplify(out_);
end;

View File

@@ -0,0 +1,120 @@
program day9part1;
{$INCLUDE 'polynomial.pas'}
function lagrange(x, y: array of int64; l: int64 = 0): polynomial;
var
new: polynomial;
idx: int64;
i: int64;
begin
lagrange := constant(c_fraction(0, 1));
if l = 0 then
begin
case length(x) > length(y) of
true: l := length(y);
false: l := length(x);
end;
end;
for idx := 0 to l - 1 do
begin
new := constant(c_fraction((y[idx]), 1));
for i := 0 to l - 1 do
begin
if i = idx then
continue;
new := new * binomial(c_fraction(1, 1), c_fraction(- x[i], 1));
new := new * constant(c_fraction(1, (x[idx] - x[i])));
end;
lagrange := lagrange + new;
end;
end;
var
{ couldn't have done that with a for loop }
x: array[0..100] of int64 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100);
y: array[0..100] of int64;
file_: text;
str: string;
negative, number: int64;
c: char;
count, b: int64;
sum: fraction;
p: polynomial;
f: fraction;
begin
assign(file_, 'resources/2023/day9.txt');
reset(file_);
sum := c_fraction(0, 1);
while not EOF(file_) do
begin
readln(file_, str);
count := 0;
number := 0;
negative := 1;
for c in str do
begin
if c = '-' then
negative := -1
else if (('0' <= c) and (c <= '9')) then
begin
//add number to number
val(c, b);
number := number * 10 + b;
end
else
begin
y[count] := number * negative;
count := count + 1;
number := 0;
negative := 1;
end;
end;
y[count] := number * negative;
p := simplify_poly(lagrange(x, y, count + 1));
print_polynomial(p);
write(' at ');
write(count + 1);
write(' is ');
f := simplify(eval_polynomial(p, count + 1));
print_fraction(f);
sum := sum + f;
writeln();
end;
write('The final sum is: ');
print_fraction(sum);
end.

View File

@@ -0,0 +1,120 @@
program day9part1;
{$INCLUDE 'polynomial.pas'}
function lagrange(x, y: array of int64; l: int64 = 0): polynomial;
var
new: polynomial;
idx: int64;
i: int64;
begin
lagrange := constant(c_fraction(0, 1));
if l = 0 then
begin
case length(x) > length(y) of
true: l := length(y);
false: l := length(x);
end;
end;
for idx := 0 to l - 1 do
begin
new := constant(c_fraction((y[idx]), 1));
for i := 0 to l - 1 do
begin
if i = idx then
continue;
new := new * binomial(c_fraction(1, 1), c_fraction(- x[i], 1));
new := new * constant(c_fraction(1, (x[idx] - x[i])));
end;
lagrange := lagrange + new;
end;
end;
var
{ couldn't have done that with a for loop }
x: array[0..100] of int64 = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100);
y: array[0..100] of int64;
file_: text;
str: string;
negative, number: int64;
c: char;
count, b: int64;
sum: fraction;
p: polynomial;
f: fraction;
begin
assign(file_, 'resources/2023/day9.txt');
reset(file_);
sum := c_fraction(0, 1);
while not EOF(file_) do
begin
readln(file_, str);
count := 0;
number := 0;
negative := 1;
for c in str do
begin
if c = '-' then
negative := -1
else if (('0' <= c) and (c <= '9')) then
begin
//add number to number
val(c, b);
number := number * 10 + b;
end
else
begin
y[count] := number * negative;
count := count + 1;
number := 0;
negative := 1;
end;
end;
y[count] := number * negative;
p := simplify_poly(lagrange(x, y, count + 1));
print_polynomial(p);
write(' at ');
write(-1);
write(' is ');
f := simplify(eval_polynomial(p, -1));
print_fraction(f);
sum := sum + f;
writeln();
end;
write('The final sum is: ');
print_fraction(sum);
end.

View File

@@ -0,0 +1,170 @@
{$mode objfpc}
uses sysutils, math;
{$include fraction.pas}
const
MAX_POLYNOMIAL_LENGTH = 100;
type
polynomial = record
degree: int64;
{ coefficients will be stored in reverse. ofc}
coefficients: array[0..MAX_POLYNOMIAL_LENGTH] of fraction;
end;
procedure fill_array_1(var a: array of fraction; l: int64 = MAX_POLYNOMIAL_LENGTH);
var
i: int64;
begin
for i := 0 to l do
a[i] := c_fraction(0, 1);
end;
{ add polynomials }
operator + (a, b: polynomial) add_polynomial: polynomial;
var
new_degree: int64;
max_degree: int64;
i: int64;
begin
case a.degree > b.degree of
true: max_degree := a.degree;
false: max_degree := b.degree;
end;
fill_array_1(add_polynomial.coefficients);
for i := 0 to max_degree do
begin
add_polynomial.coefficients[i] := a.coefficients[i] + b.coefficients[i];
if add_polynomial.coefficients[i].numerator <> 0 then
new_degree := i
end;
add_polynomial.degree := new_degree;
end;
{ mult polynomials }
operator * (a, b: polynomial) out_: polynomial;
var
i, j: int64;
new_degree: int32;
begin
out_.degree := a.degree + b.degree;
fill_array_1(out_.coefficients);
for i := 0 to a.degree do
begin
for j := 0 to b.degree do
begin
out_.coefficients[i + j] := out_.coefficients[i + j] + a.coefficients[i] * b.coefficients[j];
end;
end;
for i := 0 to out_.degree do
begin
if out_.coefficients[i].numerator <> 0 then
new_degree := i
end;
out_.degree := new_degree;
end;
function constant(c: fraction): polynomial;
begin
fill_array_1(constant.coefficients);
constant.coefficients[0] := c;
constant.degree := 0;
end;
function binomial(m, b: fraction): polynomial;
begin
fill_array_1(binomial.coefficients);
binomial.coefficients[0] := b;
binomial.coefficients[1] := m;
binomial.degree := 1;
end;
function eval_polynomial(a: polynomial; b: int512): fraction;
var
i: int64;
begin
eval_polynomial := c_fraction(0, 1);
for i := 0 to a.degree do
begin
eval_polynomial := eval_polynomial + a.coefficients[i] * c_fraction(power(b, i), 1);
end;
end;
procedure print_polynomial(a: polynomial);
var
i: int64;
begin
for i := 0 to a.degree do
begin
if (a.coefficients[a.degree - i].numerator <> 0) or (a.degree = 0) then
begin
if i <> 0 then
begin
if isneg(a.coefficients[a.degree - i].numerator) then
begin
a.coefficients[a.degree - i].numerator := -a.coefficients[a.degree - i].numerator;
write(' - ');
end
else
write(' + ');
end;
{ yeah. need an equality for fraction. }
if (a.coefficients[a.degree - i].numerator <> 1) and (a.coefficients[a.degree - i].denominator <> 1) or (i = a.degree) then
print_fraction(a.coefficients[a.degree - i]);
if i = a.degree - 1 then
write('x')
else if i < a.degree - 1 then
begin
write('x^');
write(a.degree - i);
end;
end;
end;
write(' (');
write(a.degree);
write(')');
end;
function simplify_poly(a: polynomial): polynomial;
var
i: int32;
begin
for i := 0 to a.degree do
begin
simplify_poly.coefficients[i] := simplify(a.coefficients[i]);
end;
simplify_poly.degree := a.degree;
end;

View File

@@ -0,0 +1,52 @@
state search_first
parse_int()
`z0=q`
`ds1s2`
set_state(search_second)
end
state search_second
parse_int()
`z0=q`
`s2`
end
interrupt newline
`l2l110*+`
`lo+so`
set_state(search_first)
end
interrupt program_end
`lop`
end
function parse_int
`[`
`ln48>qln57<q`
`ln48-q`
`]x`
`1`
streq(0, "one")
`1=q1+`
streq(0, "two")
`1=q1+`
streq(0, "three")
`1=q1+`
streq(0, "four")
`1=q1+`
streq(0, "five")
`1=q1+`
streq(0, "six")
`1=q1+`
streq(0, "seven")
`1=q1+`
streq(0, "eight")
`1=q1+`
streq(0, "nine")
`1=q`
`s.`
end

View File

@@ -0,0 +1,144 @@
state read_first
read_number()
`S1`
set_state(read_second)
end
state read_second
return_if(`ln` == 32)
read_number()
`S2`
end
interrupt newline
adjust_index(1)
set_state(read_first)
end
interrupt program_start
`_1S1`
`_1S2`
end
interrupt program_end
`L1st` # remove the extra -1
`_1S3`
`_1S4`
# until we drain 1
while `L1ds!` != -1 do
#`[1)]nf`
# until we drain 3
while `L3ds#` != -1 do
# if top of stack is greater than !
if `l#` >= `l!` then
`l#S3` # push # back onto 3
#`[2)]nf`
break
end
`l#S1` # push # onto 1
#`[3)]nf`
end
#`[4)]nf`
# if we popped the end of array off then put it back on
if `l#` == -1 then
`_1S3`
end
`l!S3` # push ! into temp stack
end
debug_print("sorted 1")
# until we drain 2
while `L2ds@` != -1 do
# until we drain 4
while `L4ds$` != -1 do
# if top of stack is greater than @
if `l$` >= `l@` then
`l$S4` # push $ back onto 4
break
end
`l$S2` # push $ onto 2
end
# if we popped the end of array off then put it back on
if `l$` == -1 then
`_1S4`
end
`l@S4` # push @ into temp stack
end
`0so`
debug_print("sorted")
while `L4s2L3ds1` != -1 do
`l1l2-`
abs()
`lo+so`
end
`lop`
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
-1
# ret _1 if not a digit
return_if(`ln` < 48)
return_if(`ln` > 57)
`st`
# throw the true digit onto the stack
`ln48-`
# inc i
adjust_index(1)
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
return_if(1 == `z`)
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`st`
# decrement i so we reread the skipped char
adjust_index(-1)
end
function abs
`d0<q0r-`
end

View File

@@ -0,0 +1,80 @@
state read_first
read_number()
`S1`
set_state(read_second)
end
state read_second
return_if(`ln` == 32)
read_number()
`d;2` # load current amount
`1+` # inc
`r:2` # and store
end
interrupt newline
adjust_index(1)
set_state(read_first)
end
interrupt program_start
`_1S1`
end
interrupt program_end
debug_print("wow")
# burn off one
`L1st`
while `L1ds!` != -1 do
`l!d;2*`
`lo+so`
end
`lop`
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
-1
# ret _1 if not a digit
return_if(`ln` < 48)
return_if(`ln` > 57)
`st`
# throw the true digit onto the stack
`ln48-`
# inc i
adjust_index(1)
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
return_if(1 == `z`)
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`st`
# decrement i so we reread the skipped char
adjust_index(-1)
end

View File

@@ -0,0 +1,153 @@
state start
# read a number and put it into the report stack
read_number()
`[d_1!=qs.q]x`
`SR`
end
# prime the report stack with an end token
interrupt program_start
`_1SR`
end
interrupt newline
# check sequence and add it into output
check_sequence()
`lo+so`
# increment past newline
`li1+dsi;Isn`
# clear report
`_1SR`
end
interrupt program_end
`lop`
end
function check_sequence
`[chk]n10an`
`[s.q]s?`
# return value
`0`
# start checking the first two values (+1)
`LRLRdSR-`
# return if 0 (0)
`d0=?`
# calc abs, return if > 3 (0)
`d`
abs()
`3<?`
# if desc
`[d0<qs.`
check_descending_sequence()
`+q]x` # add it's return value to 0
`[0>q`
check_ascending_sequence()
`+q]x`
end
function check_descending_sequence
`[dsc]n10an`
`[s.s.1+q]s!` # success macro
`[s.q]s?` # cleanup fail macro
# ret value
`0`
# start with smth
`LR`
`[`
`LRdSR` # grab (and replace the next character)
`d_1=!` # if we're done then break out of here as a success
`-` # get difference
`d_1<?` # if > -1 fail
`_3>q` # if < -3 fail
`LR` # grab the next
`l.x` # and loop
`]ds.x`
end
function check_ascending_sequence
`[asc]n10an`
`[s.s.1+q]s!` # success macro
`[s.q]s?` # cleanup fail macro
# ret value
`0`
# start with smth
`LR`
`[`
`LRdSR` # grab (and replace the next character)
`d_1=!` # if we're done then break out of here as a success
`-` # get difference
`d1>?` # if < 1 fail
`3<q` # if > 3 fail
`LR` # grab the next
`l.x` # and loop
`]ds.x`
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
`_1`
# ret _1 if not a digit
`ln48>q`
`ln57<q`
`s.`
# throw the true digit onto the stack
`ln48-`
# inc i
`li1+dsi;Isn`
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
`z1=q`
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`s.`
# decrement i so we reread the skipped char
`li1-dsi;Isn`
end
function abs
`d0<q0r-`
end

View File

@@ -0,0 +1,207 @@
state start
# read a number and put it into the report stack
read_number()
`[d_1!=qs.q]x`
`lc:T` # put this into T at c
`lc1+sc` #inc c
end
# prime the report stack with an end token
interrupt program_start
`_1SR`
`0sc` # count
end
interrupt newline
# check sequence and add it into output
check_all_sequences()
`lo+so`
# increment past newline
`li1+dsi;Isn`
# reset report size
`0sc`
end
function check_all_sequences
# check no edits
# start at c - 1
`lc1-`
`_1SR` # make sure it ends here
`[`
`d;T` # fetch number
`SR` # push into r
`1-` # decrement
`d_1!=.` # loop if not -1
`]ds.x`
debug(`[hello]n`)
`s.` # remove junk
check_sequence() # check sequence
`[d;TSR]s>` # macro for storing new number
`lc1-sd` # now we start skipping. starting with the dth
`[`
`_1SR` # make sure to cap report
`lc1-` # start of the thing
`[` # copy loop
`dld!=>` # copy a number iff index is not d
`1-` # decrement index
`d_1!=.` # loop if not -1
`]ds.x`
`s.` # remove junk
check_sequence() # add in this check sequence to our return
`+`
`ld1-dsd` # decrement d
debug(`[d]np`)
`_1!=<` # loop if not _1
`]ds<x`
`[d1>qs.1]x` # cap to one
end
interrupt program_end
`lop`
end
function check_sequence
debug(`[chk]n10an`)
`[s.q]s?`
# return value
`0`
# start checking the first two values (+1)
`LRLRdSR-`
# return if 0 (0)
`d0=?`
# calc abs, return if > 3 (0)
`d`
abs()
`3<?`
# if desc
`[d0<qs.`
check_descending_sequence()
`+q]x` # add it's return value to 0
`[0>q`
check_ascending_sequence()
`+q]x`
end
function check_descending_sequence
debug(`[dsc]n10an`)
`[s.s.1+q]s!` # success macro
`[s.q]s?` # cleanup fail macro
# ret value
`0`
# start with smth
`LR`
`[`
`LRdSR` # grab (and replace the next character)
`d_1=!` # if we're done then break out of here as a success
`-` # get difference
`d_1<?` # if > -1 fail
`_3>q` # if < -3 fail
`LR` # grab the next
`l.x` # and loop
`]ds.x`
end
function check_ascending_sequence
debug(`[asc]n10an`)
`[s.s.1+q]s!` # success macro
`[s.q]s?` # cleanup fail macro
# ret value
`0`
# start with smth
`LR`
`[`
`LRdSR` # grab (and replace the next character)
`d_1=!` # if we're done then break out of here as a success
`-` # get difference
`d1>?` # if < 1 fail
`3<q` # if > 3 fail
`LR` # grab the next
`l.x` # and loop
`]ds.x`
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
`_1`
# ret _1 if not a digit
`ln48>q`
`ln57<q`
`s.`
# throw the true digit onto the stack
`ln48-`
# inc i
`li1+dsi;Isn`
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
`z1=q`
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`s.`
# decrement i so we reread the skipped char
`li1-dsi;Isn`
end
function abs
`d0<q0r-`
end

View File

@@ -0,0 +1,100 @@
interrupt program_start
`[`
set_state(search_mul)
`q]s!` # fail subroutine, go back to looking for m
`0so` # setup output register
end
interrupt program_end
`lop` # lop
end
state search_mul
streq(0, "mul(")
`0=q` # if not mul( continue
`li3+dsi;Isn` # increment i past the string
set_state(search_first_num) # else get number
end
state search_first_num
read_number()
`ds1` # read and store the first number
`_1=!` # if it's not a real number go back
set_state(search_comma)
end
state search_comma
`ln44!=!` # if not a comma break
set_state(search_second_num)
end
state search_second_num
read_number()
`ds2` # read and store the second number
`_1=!` # if it' not a number go back
set_state(search_end_paren)
end
state search_end_paren
`ln41!=!` # if it's not a ")" this instruction sucks
debug(`[got one]n10an`)
`l1l2*` # calculate the multiply
`lo+so` # add it into output
set_state(search_mul)
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
`_1`
# ret _1 if not a digit
`ln48>q`
`ln57<q`
`s.`
# throw the true digit onto the stack
`ln48-`
# inc i
`li1+dsi;Isn`
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
`z1=q`
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`s.`
# decrement i so we reread the skipped char
`li1-dsi;Isn`
end

View File

@@ -0,0 +1,127 @@
interrupt program_start
`[`
set_state(search_mul)
`li1-dsi;Isn` # go back a character -- just in case this was the start of something
`q]s!` # fail subroutine, go back to looking for m
`0so` # setup output register
`1se` # start enabled
end
interrupt program_end
`lop` # lop
end
state search_mul
# check for do()
streq(0, "do()")
`[0=q` # if not do nothing
`1se` # enable
`q` # we're done here
`]x`
# check for don't()
streq(0, "don't()")
`[0=q` # if not do nothing
`0se` # disable
`q` # we're done here
`]x`
streq(0, "mul(")
`0=q` # if not mul( continue
adjust_index(3) # increment i past the string
set_state(search_first_num) # else get number
end
state search_first_num
read_number()
`ds1` # read and store the first number
`_1=!` # if it's not a real number go back
set_state(search_comma)
end
state search_comma
`ln44!=!` # if not a comma break
set_state(search_second_num)
end
state search_second_num
read_number()
`ds2` # read and store the second number
`_1=!` # if it' not a number go back
set_state(search_end_paren)
end
state search_end_paren
`ln41!=!` # if it's not a ")" this instruction sucks
debug(`[got one]n10an`)
# check enabled
`le`
`[1=q`
debug(`[disabled though]n10an`)
`]x`
# actually quit
`le0=!`
`l1l2*` # calculate the multiply
`lo+so` # add it into output
set_state(search_mul)
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
`_1`
# ret _1 if not a digit
`ln48>q`
`ln57<q`
`s.`
# throw the true digit onto the stack
`ln48-`
# inc i
`li1+dsi;Isn`
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
`z1=q`
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`s.`
# decrement i so we reread the skipped char
`li1-dsi;Isn`
end

View File

@@ -0,0 +1,128 @@
state seek_newline
# if not newline quit
`ln10!=q`
# get the width (plus1 cause newline)
`li1+sw`
# go back to start
set_state(findxmas)
rewind()
end
state findxmas
`[lo1+so]s.` # increment
streq(0, "XMAS")
`1=.` # inc if equal
streq(1, "SAMX")
`1=.` # inc if equal
# verts
search_down_xmas()
search_down_samx()
search_dr_xmas()
search_dr_samx()
search_dl_xmas()
search_dl_samx()
debug(`lon10an`)
end
function search_down_xmas
#debug_print("hello")
#debug(`li;In10an`)
`li;I88!=q` # if index is not X quit
#debug_print("1")
#debug(`lilw+;In10an`)
`lilw+;I77!=q` # if index + width is not M quit
#debug_print("2")
#debug(`lilw2*+;In10an`)
`lilw2*+;I65!=q` # if index + 2* width iw not A quit
#debug_print("3")
`lilw3*+;I83!=q` # if index + 3* width is not A quit
#debug_print("4")
`lo1+so` # increment
end
function search_down_samx
#debug_print("hello")
#debug(`li;In10an`)
`li;I83!=q`
`lilw+;I65!=q`
`lilw2*+;I77!=q`
`lilw3*+;I88!=q`
`lo1+so` # increment
end
function search_dr_xmas
`li;I88!=q`
`lilw1++;I77!=q`
`lilw1+2*+;I65!=q`
`lilw1+3*+;I83!=q`
`lo1+so` # increment
end
function search_dr_samx
`li;I83!=q`
`lilw1++;I65!=q`
`lilw1+2*+;I77!=q`
`lilw1+3*+;I88!=q`
`lo1+so` # increment
end
function search_dl_xmas
`li;I88!=q`
`lilw1-+;I77!=q`
`lilw1-2*+;I65!=q`
`lilw1-3*+;I83!=q`
`lo1+so` # increment
end
function search_dl_samx
`li;I83!=q`
`lilw1-+;I65!=q`
`lilw1-2*+;I77!=q`
`lilw1-3*+;I88!=q`
`lo1+so` # increment
end
interrupt program_start
`0so` # start output as 0
end
interrupt program_end
debug(`lwn10an`)
`lon`
end

View File

@@ -0,0 +1,85 @@
state seek_newline
# if not newline quit
`ln10!=q`
# get the width (plus1 cause newline)
`li1+sw`
# go back to start
set_state(findxmas)
rewind()
end
state findxmas
search_mm()
search_sm()
search_ms()
search_ss()
debug(`lon10an`)
end
function search_mm
# x y
`li;I77!=q` # [0][0] = m
`li2+;I77!=q` # [0][2] = m
`lilw1++;I65!=q` # [1][1] = a
`lilw2*+;I83!=q` # [2][0] = s
`lilw1+2*+;I83!=q` # [2][2] = s
`lo1+so` # increment
end
function search_sm
# x y
`li;I83!=q` # [0][0] = s
`li2+;I77!=q` # [0][2] = m
`lilw1++;I65!=q` # [1][1] = a
`lilw2*+;I83!=q` # [2][0] = s
`lilw1+2*+;I77!=q` # [2][2] = m
`lo1+so` # increment
end
function search_ms
# x y
`li;I77!=q` # [0][0] = m
`li2+;I83!=q` # [0][2] = s
`lilw1++;I65!=q` # [1][1] = a
`lilw2*+;I77!=q` # [2][0] = m
`lilw1+2*+;I83!=q` # [2][2] = s
`lo1+so` # increment
end
function search_ss
# x y
`li;I83!=q` # [0][0] = m
`li2+;I83!=q` # [0][2] = m
`lilw1++;I65!=q` # [1][1] = a
`lilw2*+;I77!=q` # [2][0] = s
`lilw1+2*+;I77!=q` # [2][2] = s
`lo1+so` # increment
end
interrupt program_start
`0so` # start output as 0
end
interrupt program_end
debug(`lwn10an`)
`lon`
end

View File

@@ -0,0 +1,172 @@
state rule_read_first
read_number()
`s1` # store this in 1
set_state(rule_read_second)
end
state rule_read_second
return_if(`ln` == 124)
read_number()
# calculate list size
`l1;$`
# calculate list offset
`l1`
`100*+` # num * 100 + size
`:%` # store the num on the array
`l1;$1+` # inc size
`l1:$` # and store
end
state manual_read
return_if(`ln` == 44)
read_number()
`lc:3` # store it in an array at C
`lc1+sc`
end
interrupt newline
if `l=` == 2 then
if verify_manual() == 1 then
get_middle()
`lo+so`
end
adjust_index(1)
`0sc`
end
# rule reading
if `l=` == 1 then
adjust_index(1) # increment to next
set_state(rule_read_first)
# if still newline
if `ln` == 10 then
set_state(manual_read)
`0sc`
`2s=`
adjust_index(1)
end
end
end
function get_middle
`lc2/` # get middle
`;3` # and index
end
# ok.
function verify_manual
# from 0 to c - 1
`0s!`
while `l!` < `lc1-` do
# load list offset
`l!;3`
`100*s1`
# from ! + 1 to c
`l!1+s?`
while `l?` < `lc` do
`l?;3`
`s2` # load value
# return 0 if not found
if list_lookup() == 0 then
return 0
end
`l?1+s?`
end
`l!1+s!`
end
1
end
# takes offset in 1, value in 2
function list_lookup
# so we don't clobber 1
`l1s.`
while `l.;%` != 0 do
if `l.;%` == `l2` then
return 1
end
`l.1+s.`
end
0
end
interrupt program_start
`1s=`
end
interrupt program_end
`lop`
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
-1
# ret _1 if not a digit
return_if(`ln` < 48)
return_if(`ln` > 57)
`st`
# throw the true digit onto the stack
`ln48-`
# inc i
adjust_index(1)
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
return_if(1 == `z`)
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`st`
# decrement i so we reread the skipped char
adjust_index(-1)
end
function abs
`d0<q0r-`
end

View File

@@ -0,0 +1,205 @@
state rule_read_first
read_number()
`s1` # store this in 1
set_state(rule_read_second)
end
state rule_read_second
return_if(`ln` == 124)
read_number()
# calculate list size
`l1;$`
# calculate list offset
`l1`
`100*+` # num * 100 + size
`:%` # store the num on the array
`l1;$1+` # inc size
`l1:$` # and store
end
state manual_read
return_if(`ln` == 44)
read_number()
`lc:3` # store it in an array at C
`lc1+sc`
end
interrupt newline
if `l=` == 2 then
if verify_manual() == 0 then
debug(`[wowie]n10an`)
fix_manual()
get_middle()
`lo+so`
end
adjust_index(1)
`0sc`
end
# rule reading
if `l=` == 1 then
adjust_index(1) # increment to next
set_state(rule_read_first)
# if still newline
if `ln` == 10 then
set_state(manual_read)
`0sc`
`2s=`
adjust_index(1)
end
end
end
function fix_manual
# from 0 to c
`0s!`
while `l!` < `lc` do
# load list offset
`l!;3`
`100*s1`
# from 0 to c
`0s?`
`0` # start sum
while `l?` < `lc` do
if `l?` != `l!` then
# load value
`l?;3s2`
list_lookup()
`+` # add lookup into sum
end
`l?1+s?`
end
`lcr-1-` # reverse index
`l!;3` # load number
`r:4` # store into 4
`l!1+s!`
end
end
function get_middle
`lc2/` # get middle
`;4` # and index
end
# ok.
function verify_manual
# from 0 to c - 1
`0s!`
while `l!` < `lc1-` do
# load list offset
`l!;3`
`100*s1`
# from ! + 1 to c
`l!1+s?`
while `l?` < `lc` do
`l?;3`
`s2` # load value
# return 0 if not found
if list_lookup() == 0 then
return 0
end
`l?1+s?`
end
`l!1+s!`
end
1
end
# takes offset in 1, value in 2
function list_lookup
# so we don't clobber 1
`l1s.`
while `l.;%` != 0 do
if `l.;%` == `l2` then
return 1
end
`l.1+s.`
end
0
end
interrupt program_start
`1s=`
end
interrupt program_end
`lop`
end
function read_number
read_number_start()
read_number_end()
end
function read_number_start
-1
# ret _1 if not a digit
return_if(`ln` < 48)
return_if(`ln` > 57)
`st`
# throw the true digit onto the stack
`ln48-`
# inc i
adjust_index(1)
# recurse
read_number_start()
end
function read_number_end
# if we only have 1 item on stack (-1) we found no number, so return
return_if(1 == `z`)
# push entire number thing onto temporary stack
`[STz0<.]ds.x`
# multiply ten then pop and add repeatedly until done
`0`
`[LTd_1=qr10*+l.x]ds.x`
# get rid of the extra -1
`st`
# decrement i so we reread the skipped char
adjust_index(-1)
end
function abs
`d0<q0r-`
end

View File

@@ -0,0 +1,5 @@
print(
sum([a[0]*10 + a[-1] for a in [[int(b) for b in c if b.isnumeric()] for c in open('resources/2023/day1.txt').read().split("\n")[:-1]]])
)
# sum([a[0]*10 + a[-1] for a in [[int(b) for b in c if b.isnumeric()] for c in open('resources/2023/day1.txt').read().split("\n")[:-1]]])

View File

@@ -0,0 +1,14 @@
print(
sum(
[a[0]*10 + a[-1] for a in
[
[int(b) for b in c.replace("eight", "e8t").replace("two", "2o").replace("one", "1").replace("five", "5").replace("seven", "7n")
.replace("nine", "9").replace("six", '6').replace("four", "4").replace("three", "3") if b.isnumeric()
] for c in open('resources/2023/day1.txt').read().split("\n")[:-1]
]
]
)
)
# sum([a[0]*10 + a[-1] for a in [[int(b) for b in c.replace("eight", "e8t").replace("two", "2o").replace("one", "1").replace("five", "5").replace("seven", "7n").replace("nine", "9").replace("six", '6').replace("four", "4").replace("three", "3") if b.isnumeric()] for c in open('resources/2023/day1.txt').read().split("\n")[:-1]]])

View File

@@ -0,0 +1,14 @@
print(
sum([
(y+1) * (0 if
(
sum([int(x.split(" ")[0]) > 12 for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'red' in x]) +
sum([int(x.split(" ")[0]) > 13 for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'green' in x]) +
sum([int(x.split(" ")[0]) > 14 for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'blue' in x])
) > 0 else 1)
for y, z in enumerate(open('resources/2023/day2.txt').readlines())
])
)
# sum([(y+1) * (0 if (sum([int(x.split(" ")[0]) > 12 for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'red' in x]) + sum([int(x.split(" ")[0]) > 13 for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'green' in x]) + sum([int(x.split(" ")[0]) > 14 for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'blue' in x])) > 0 else 1) for y, z in enumerate(open('resources/2023/day2.txt').readlines())])

View File

@@ -0,0 +1,12 @@
print(
sum(
[
max([int(x.split(" ")[0]) for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'red' in x]) *
max([int(x.split(" ")[0]) for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'green' in x]) *
max([int(x.split(" ")[0]) for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'blue' in x])
for z in open('resources/2023/day2.txt').readlines()
]
)
)
# sum([max([int(x.split(" ")[0]) for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'red' in x]) * max([int(x.split(" ")[0]) for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'green' in x]) * max([int(x.split(" ")[0]) for x in z.split(": ")[1][:-1].replace(";", ",").split(", ") if 'blue' in x]) for z in open('resources/2023/day2.txt').readlines()])

View File

@@ -0,0 +1,21 @@
print(sum(sum(
[[m[2] for m in zip(*l) if m[0] and not (m[1] and m[2] == m[3]) and m[2] != -1] for l in
list(map(lambda x, y: (x, [False] + x, y, [-1] + y),
[[sum(n) > 0 for n in zip(*m)] for m in zip(
*list(map(lambda x: [
[[False] + q for q in [[False] * len(x[0])] + x], [[False] * len(x[0])] + x, [q[1:] + [False] for q in [[False] * len(x[0])] + x],
[[False] + q for q in x], x, [q[1:] + [False] for q in x],
[[False] + q for q in x[1:] + [[False] * len(x[0])]], x[1:] + [[False] * len(x[0])], [q[1:] + [False] for q in x[1:] + [[False] * len(x[0])]]],
[[[x not in '0123456789.' for x in l] for l in open("resources/2023/day3.txt").read().split("\n")]] # array of True when a symbol
))[0]
)], # array of True when next to a symbol
[[max(a) if a[1] != -1 else -1 for a in zip(*b)] for b in zip(
*list(map(lambda x: [[[-1] + q for q in x], x, [q[1:] + [-1] for q in x]],
[[[int("".join(c).strip('.!@#$%^&*()_+-=/')) if c[1] in '0123456789' else -1 for c in zip('.' + l, l, l[1:] + '.')] for l in open("resources/2023/day3.txt").read().split("\n")]]
))[0]
)] # array of -1, or the number.
))
], []
)))
# sum(sum([[m[2] for m in zip(*l) if m[0] and not (m[1] and m[2] == m[3]) and m[2] != -1] for l in list(map(lambda x, y: (x, [False] + x, y, [-1] + y), [[sum(n) > 0 for n in zip(*m)] for m in zip(*list(map(lambda x: [[[False] + q for q in [[False] * len(x[0])] + x], [[False] * len(x[0])] + x, [q[1:] + [False] for q in [[False] * len(x[0])] + x], [[False] + q for q in x], x, [q[1:] + [False] for q in x], [[False] + q for q in x[1:] + [[False] * len(x[0])]], x[1:] + [[False] * len(x[0])], [q[1:] + [False] for q in x[1:] + [[False] * len(x[0])]]], [[[x not in '0123456789.' for x in l] for l in open("resources/2023/day3.txt").read().split("\n")]]))[0])], [[max(a) if a[1] != -1 else -1 for a in zip(*b)] for b in zip(*list(map(lambda x: [[[-1] + q for q in x], x, [q[1:] + [-1] for q in x]], [[[int("".join(c).strip('.!@#$%^&*()_+-=/')) if c[1] in '0123456789' else -1 for c in zip('.' + l, l, l[1:] + '.')] for l in open("resources/2023/day3.txt").read().split("\n")]]))[0])]))], []))

View File

@@ -0,0 +1,28 @@
print(sum([
v[0] * v[1] for v in # sums all asterisks with > 2
[
[sum([g[w, a] for a in range(140) if abs(w - a*140) < 280], []) for w in range(140**2)] for g in # coagulate the dictionaries
[{
(r*140 + p, r): [m[2] for m in zip(*l) if m[0] and not (m[1] and m[2] == m[3]) and m[2] != -1 and r*140 + p in m[0]] # find adjacent numbers
for p in range(-280, 280) for r, l in enumerate( # from part 1.
list(map(lambda x, y: (x, [-1] + x, y, [-1] + y),
[[[l for l in n if l > 0] for n in zip(*m)] for m in zip(
*list(map(lambda x: [
[[False] + q for q in [[False] * len(x[0])] + x], [[False] * len(x[0])] + x, [q[1:] + [False] for q in [[False] * len(x[0])] + x],
[[False] + q for q in x], x, [q[1:] + [False] for q in x],
[[False] + q for q in x[1:] + [[False] * len(x[0])]], x[1:] + [[False] * len(x[0])], [q[1:] + [False] for q in x[1:] + [[False] * len(x[0])]]],
[[[i * 140 + j if b == "*" else -1 for j, b in enumerate(a)] for i, a in enumerate(open("resources/2023/day3.txt").read().split("\n"))]] # array of asterisk ids, or -1
))[0]
)], # array of nearby asterissks + id
[[max(a) if a[1] != -1 else -1 for a in zip(*b)] for b in zip(
*list(map(lambda x: [[[-1] + q for q in x], x, [q[1:] + [-1] for q in x]],
[[[int("".join(c).strip('.!@#$%^&*()_+-=/')) if c[1] in '0123456789' else -1 for c in zip('.' + l, l, l[1:] + '.')] for l in open("resources/2023/day3.txt").read().split("\n")]]
))[0]
)] # array of -1, or the number.
))
)
}]
][0] if len(v) >= 2
]))
# sum([v[0] * v[1] for v in [[sum([g[w, a] for a in range(140) if abs(w - a*140) < 280], []) for w in range(140**2)] for g in [{(r*140 + p, r): [m[2] for m in zip(*l) if m[0] and not (m[1] and m[2] == m[3]) and m[2] != -1 and r*140 + p in m[0]] for p in range(-280, 280) for r, l in enumerate(list(map(lambda x, y: (x, [-1] + x, y, [-1] + y), [[[l for l in n if l > 0] for n in zip(*m)] for m in zip(*list(map(lambda x: [[[False] + q for q in [[False] * len(x[0])] + x], [[False] * len(x[0])] + x, [q[1:] + [False] for q in [[False] * len(x[0])] + x],[[False] + q for q in x], x, [q[1:] + [False] for q in x], [[False] + q for q in x[1:] + [[False] * len(x[0])]], x[1:] + [[False] * len(x[0])], [q[1:] + [False] for q in x[1:] + [[False] * len(x[0])]]], [[[i * 140 + j if b == "*" else -1 for j, b in enumerate(a)] for i, a in enumerate(open("resources/2023/day3.txt").read().split("\n"))]]))[0])], [[max(a) if a[1] != -1 else -1 for a in zip(*b)] for b in zip(*list(map(lambda x: [[[-1] + q for q in x], x, [q[1:] + [-1] for q in x]], [[[int("".join(c).strip('.!@#$%^&*()_+-=/')) if c[1] in '0123456789' else -1 for c in zip('.' + l, l, l[1:] + '.')] for l in open("resources/2023/day3.txt").read().split("\n")]]))[0])])))}]][0] if len(v) >= 2])

View File

@@ -0,0 +1,11 @@
print(
sum([[0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512][p] for p in
[sum(
[[b in x[0] for b in x[1]] for x in [
[[int(y) for y in x.strip().split(" ") if len(y) != 0] for x in l.split(':')[1].split("|")]
]][0]
) for l in open("resources/2023/day4.txt").readlines()]
])
)
# sum([[0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512][p] for p in [sum([[b in x[0] for b in x[1]] for x in [[[int(y) for y in x.strip().split(" ") if len(y) != 0] for x in l.split(':')[1].split("|")]]][0]) for l in open("resources/2023/day4.txt").readlines()]])

View File

@@ -0,0 +1,34 @@
def print2d(x):
print("\n".join([str(xx) for xx in x]))
a = [sum(
[[b in x[0] for b in x[1]] for x in [
[[int(y) for y in x.strip().split(" ") if len(y) != 0] for x in l.split(':')[1].split("|")]
]][0]
) for l in open("resources/2023/day4.txt").readlines()]
# print(a)
b = [
[d[x] for x in range(20) for d in [a]]
]
e = [2, 1, 1, 0, 0]
# [1, 2, 4, 5, 1]
# [0, 1, 1, 0, 0]
# [0, 0, 1, 0, 0]
# [0, 0, 0, 1, 0]
# [0, 0, 0, 0, 0]
# [0, 0, 0, 0, 0]
p = [[1 if x > c and x < c + 1 + i else 0 for x in range(5)] for c, i in enumerate(e)]
print2d(p)
print(p)
print([
[sum([p[x][y] for x in range(5)]) for y in range(5)]
])

View File

@@ -0,0 +1,53 @@
print(
min(
[
[
[
max(f) if max(f) != -1 else h
for f in [[g(h) for g in m[6]]] # final map
][0] for h in [
[
max(f) if max(f) != -1 else h
for f in [[g(h) for g in m[5]]] # sixth map
][0] for h in [
[
max(f) if max(f) != -1 else h
for f in [[g(h) for g in m[4]]] # fifth map
][0] for h in [
[
max(f) if max(f) != -1 else h
for f in [[g(h) for g in m[3]]] # fourth map
][0] for h in [
[
max(f) if max(f) != -1 else h
for f in [[g(h) for g in m[2]]] # third map
][0] for h in [
[
max(f) if max(f) != -1 else h
for f in [[g(h) for g in m[1]]] # second map
][0] for h in [
[
max(f) if max(f) != -1 else h
for f in [[g(h) for g in m[0]]] # first map
][0] for h in [
int(x) for x in open("resources/2023/day5.txt").readlines()[0].split(":")[1].strip().split(" ") # seeds
]
]
]
]
]
]
]
] for m in [[
list(map(
lambda d: lambda e: e + d[0] - d[1] if e >= d[1] and e < d[1] + d[2] else -1,
[[int(a) for a in b.split(" ")] for b in c.strip().split("\n")[1:]] # bullshit to get maps
))
for c in open("resources/2023/day5.txt").read().split("\n\n")[1:] # maps
]]
][0]
)
)
#min([[[max(f) if max(f) != -1 else h for f in [[g(h) for g in m[6]]]][0] for h in [[max(f) if max(f) != -1 else h for f in [[g(h) for g in m[5]]]][0] for h in [[max(f) if max(f) != -1 else h for f in [[g(h) for g in m[4]]]][0] for h in [[max(f) if max(f) != -1 else h for f in [[g(h) for g in m[3]]]][0] for h in [[max(f) if max(f) != -1 else h for f in [[g(h) for g in m[2]]]][0] for h in [[max(f) if max(f) != -1 else h for f in [[g(h) for g in m[1]]]][0] for h in [[max(f) if max(f) != -1 else h for f in [[g(h) for g in m[0]]]][0] for h in [int(x) for x in open("resources/2023/day5.txt").readlines()[0].split(":")[1].strip().split(" ")]]]]]]]] for m in [[list(map(lambda d: lambda e: e + d[0] - d[1] if e >= d[1] and e < d[1] + d[2] else -1, [[int(a) for a in b.split(" ")] for b in c.strip().split("\n")[1:]])) for c in open("resources/2023/day5.txt").read().split("\n\n")[1:]]]][0])

View File

@@ -0,0 +1,19 @@
print(
sum([a * (c + 1) for c, (_, a) in enumerate(sorted( # sort by hand value and payout bets according to rank
[(sum([ # total hand value
[max(
13**5 * 6 if 5 in d else 0, # five of a kind
13**5 * 5 if 4 in d else 0, # four of a kind
13**5 * 4 if 3 in d and 2 in d else 0, # full house
13**5 * 3 if 3 in d else 0, # three of a kind
13**5 * 2 if list(d).count(2) == 2 else 0, # two pair
13**5 if 2 in d else 0 # pair
) for d in [{k: b.count(k) for k in b}.values()]][0], # total type value (value from the type of hand)
sum([13**(4 - e) * '23456789TJQKA'.index(a) for e, a in enumerate(b)]) # total card value (value from the type of card)
]), int(v)) # makes an array of form (total hand value, bet)
for b, v in [x.split(' ') for x in open('resources/2023/day7.txt').read().split("\n")] # reads file split on \n
]
))])
)
#sum([a * (c + 1) for c, (_, a) in enumerate(sorted([(sum([[max(13**5 * 6 if 5 in d else 0, 13**5 * 5 if 4 in d else 0, 13**5 * 4 if 3 in d and 2 in d else 0, 13**5 * 3 if 3 in d else 0, 13**5 * 2 if list(d).count(2) == 2 else 0, 13**5 if 2 in d else 0) for d in [{k: b.count(k) for k in b}.values()]][0], sum([13**(4 - e) * '23456789TJQKA'.index(a) for e, a in enumerate(b)])]), int(v)) for b, v in [x.split(' ') for x in open('resources/2023/day7.txt').read().split("\n")]]))])

1350
src/z80/2023/day13/input.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,342 @@
.org 0x0000
LD HL, FILE;
main_loop:
CALL LOAD_MAP
PUSH HL
CALL CHECK_MAP
POP HL
JR C, vert
;; ld a into bc
LD B, 0;
LD C, A;
;; add it into IX
ADD IX, BC
JR vh_end
vert
;; ld a into bc
LD B, 0;
LD C, A;
;; add it into IY
ADD IY, BC
vh_end
;; test if (HL) is 0
XOR A
CP (HL)
JR NZ, main_loop
;; mult IY by 100 into hl
PUSH IY
POP HL
ADD HL, HL
ADD HL, HL
PUSH HL ; 4
ADD HL, HL
ADD HL, HL
ADD HL, HL
PUSH HL ; 32
ADD HL, HL ; 64
POP BC
ADD HL, BC ; 64 + 32
POP BC
ADD HL, BC ; 64 + 32 + 4
;; add in IX
PUSH IX
POP BC
ADD HL, BC
HALT
; cool funny function stuff
.org 0x1000
start
defb 00h
end
defb 00h
count
defb 00h
CHECK_V_MIRROR:
; map in (HL)
; col in A
; width in B
; height in C
LD HL, map
LD DE, map
; A = 2 * col - map.width
SLA A ; A = 2 * col
PUSH AF ; save 2 * col
SUB B ; A = 2 * col - map.width
ADD A, 2 ; for off by 1 errors or some shit idfk
; clip it to be 0
JP P, v_pos
LD A, 0
v_pos
LD HL, map
LD (start), A ; move 2 * col - map width (start check) into start
LD L, A ; and to L for safekeeping
POP AF ; restore A to 2 * col;
SUB L ; A = 2 * col - start
INC A ; A = 2 * col - start + 1
LD (end), A ; store that in end
SUB L ; A is the difference
SRL A ; divide by 2
INC A ; + 1
LD (count), A ; you got the counter for the inner loop
v_loop_out
; move col into B for the counter
LD A, (count)
LD B, A
; mov start and end into the registers
LD A, (start)
LD L, A
LD A, (end)
LD E, A
v_loop_in
; compare the two characters
LD A, (DE)
CP A, (HL)
; return NZ if they're not equal
RET NZ
; next character
DEC E
INC L
; :clap: :clap: next meme
DEC B
JR NZ, v_loop_in
vq
;; go to next line
INC H
INC D
DEC C ; dec the loop counter and loop if negative
JP NZ, v_loop_out
vq2
XOR A ; set zero flag and return
RET
CHECK_H_MIRROR:
; map in (HL)
; col in A
; width in B
; height in C
LD HL, map
LD DE, map
; A = 2 * col - map.height
SLA A ; A = 2 * col
PUSH AF ; save 2 * col
SUB C ; A = 2 * col - map.height
ADD A, 2 ; for off by 1 errors or some shit idfk
; clip it to be 0
JP P, h_pos
LD A, 0
h_pos
LD (start), A ; move 2 * col - map width (start check) into start
LD D, A ; and to L for safekeeping
POP AF ; restore A to 2 * col;
SUB D ; A = 2 * col - start
INC A ; A = 2 * col - start + 1
LD (end), A ; store that in end
SUB D ; A is the difference
SRL A ; divide by 2
INC A ; + 1
LD (count), A ; you got the counter for the inner loop
h_loop_out
; move col into C for the counter
LD A, (count)
LD C, A
; mov start and end into the registers
LD A, (start)
ADD A, 60h
LD H, A
LD A, (end)
ADD A, 60h
LD D, A
h_loop_in
; compare the two characters
LD A, (DE)
CP A, (HL)
; return NZ if they're not equal
RET NZ
; next character
DEC D
INC H
; :clap: :clap: next meme
DEC C
JR NZ, h_loop_in
hq
; HALT
;; go to next line
INC E
INC L
DEC B ; dec the loop counter and loop if negative
JP NZ, h_loop_out
hq2
XOR A ; set zero flag and return
RET
CHECK_MAP:
; B is width, C is height
LD A, B
DEC A
v_detect_loop
PUSH AF ; save loop count
PUSH BC ; save width + height
LD HL, map ; map as input
CALL CHECK_V_MIRROR;
JR NZ, v_not_it
POP BC
POP AF ; fix the stack
INC A ; for off by one errors
OR A ; clear carry, cause it is a vert mirror
RET
v_not_it:
POP BC
POP AF ; get values back
DEC A
JP P, v_detect_loop
vcq
;; load height-1 into A
LD A, C
DEC A
h_detect_loop
PUSH AF ; save loop count
PUSH BC ; save width + height
LD HL, map ; map as input
CALL CHECK_H_MIRROR;
JR NZ, h_not_it
POP BC
POP AF ; fix the stack
INC A ; for off by one errors
SCF ; carry, cause it is a horiz mirror
RET
h_not_it:
POP BC
POP AF ; fix the stack
DEC A
JP P, h_detect_loop
hcq
LD A, 0xFF;
RET
LOAD_MAP:
; hl: address to start of map
; out : bc, width; height
LD BC, 0;
LD DE, map ; start of map
l_loop:
; HALT
LD A, (hl) ; get character
;; go to next thing
INC HL
CP A, 0x0A ; check if newline
JR NZ, l_not_newline
;; check E is 0, break if so
LD A, E
OR A
RET Z
;; set width to this width, increment C
LD B, E
INC C
;; mov to beginning of next line
LD E, 0
INC D
JP l_loop;
l_not_newline
LD (DE), A ; copy character
; go to next address
INC E
; loop
JP l_loop;
.org 0x6000
map
DEFM 'fukfukfukfukfukfukfukfukfukfuk'
.org 0x8000
FILE
INCBIN "input.txt"
DEFB 0

View File

@@ -0,0 +1,18 @@
import sys
import argparse
parser = argparse.ArgumentParser(prog="preprocess.py")
parser.add_argument("input", nargs='?', help="input file",
type=argparse.FileType('r'), default=sys.stdin)
parser.add_argument("-o", "--output", nargs='?', help="output file",
type=argparse.FileType('w'), default=sys.stdout)
args = parser.parse_args(sys.argv[1:])
contents = args.input.read()
args.output.write(
" ".join([str(ord(c)) for c in contents])
)
args.output.close()

Some files were not shown because too many files have changed in this diff Show More