Compare commits

...

2 commits

Author SHA1 Message Date
6ab1ba5ff1
Add solution to day 5. 2025-12-07 22:43:57 +01:00
22207e0791
Add solution to day 4. 2025-12-07 22:43:52 +01:00
8 changed files with 1533 additions and 0 deletions

View file

@ -79,6 +79,34 @@ executable day3
, base >=4.7 && <5
default-language: Haskell2010
executable day4
main-is: Main.hs
other-modules:
Paths_aoc
autogen-modules:
Paths_aoc
hs-source-dirs:
app/day4
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
aoc
, base >=4.7 && <5
default-language: Haskell2010
executable day5
main-is: Main.hs
other-modules:
Paths_aoc
autogen-modules:
Paths_aoc
hs-source-dirs:
app/day5
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
aoc
, base >=4.7 && <5
default-language: Haskell2010
test-suite aoc-test
type: exitcode-stdio-1.0
main-is: Spec.hs

82
2025/aoc/app/day4/Main.hs Normal file
View file

@ -0,0 +1,82 @@
module Main (main) where
data Cell = Paper | Empty deriving (Eq, Show)
type Row = [Cell]
type Grid = [Row]
type Coords = (Int, Int)
parseGrid :: [String] -> Grid
parseGrid = map parseRow
where
parseCell :: Char -> Cell
parseCell '@' = Paper
parseCell '.' = Empty
parseCell _ = error "Invalid!"
parseRow :: String -> Row
parseRow = map parseCell
paperCount :: Grid -> Int
paperCount = sum . map (length . filter (== Paper))
validPosition :: Grid -> Coords -> Bool
validPosition grid (row, col) = row >= 0 && row < length grid && col >= 0 && col < length (head grid)
isPaper :: Grid -> Coords -> Bool
isPaper grid (row, col)
| validPosition grid (row, col) = grid !! row !! col == Paper
| otherwise = False
getSurrounding :: Coords -> [Coords]
getSurrounding (row, col) =
[ (row + i, col + j)
| i <- [-1 .. 1],
j <- [-1 .. 1],
i /= 0 || j /= 0
]
paperSurrounding :: Grid -> Coords -> Int
paperSurrounding grid (row, col) = (length . filter id . map (isPaper grid)) (getSurrounding (row, col))
eligibleForPickup :: Grid -> Coords -> Bool
eligibleForPickup grid (row, col) = isPaper grid (row, col) && paperSurrounding grid (row, col) < 4
countEligibleRolls :: Grid -> Int
countEligibleRolls grid =
(length . filter id)
[ eligibleForPickup grid (row, col)
| row <- [0 .. length grid - 1],
col <- [0 .. length (head grid) - 1]
]
part1 :: IO ()
part1 =
getContents
>>= print . countEligibleRolls . parseGrid . lines
removeEligibleRolls :: Grid -> Grid
removeEligibleRolls grid =
[ [ if eligibleForPickup grid (row, col) then Empty else grid !! row !! col
| col <- [0 .. length (head grid) - 1]
]
| row <- [0 .. length grid - 1]
]
loopRemoveRolls :: Grid -> Grid
loopRemoveRolls grid
| grid == removeEligibleRolls grid = grid
| otherwise = loopRemoveRolls (removeEligibleRolls grid)
totalRollsEligible :: Grid -> Int
totalRollsEligible grid = paperCount grid - paperCount (loopRemoveRolls grid)
part2 :: IO ()
part2 =
getContents
>>= print . totalRollsEligible . parseGrid . lines
main :: IO ()
main = part2

76
2025/aoc/app/day5/Main.hs Normal file
View file

@ -0,0 +1,76 @@
module Main (main) where
import Data.List (isPrefixOf, sort)
import Debug.Trace
type Range = (Int, Int)
type FreshDatabase = [Range]
takeWhileList :: ([a] -> Bool) -> [a] -> [a]
takeWhileList _ [] = []
takeWhileList f (x : xs)
| f (x : xs) = x : takeWhileList f xs
| otherwise = []
splitOn :: (Eq a) => [a] -> [a] -> [[a]]
splitOn x [] = []
splitOn x xs =
let e = takeWhileList (not . isPrefixOf x) xs
in e : splitOn x (drop (length e + length x) xs)
processRange :: String -> Range
processRange s =
case splitOn "-" s of
[a, b] -> (read a :: Int, read b :: Int)
_ -> error "Invalid range!"
isFresh :: FreshDatabase -> Int -> Bool
isFresh [] _ = False
isFresh ((start, end) : xs) v = start <= v && v <= end || isFresh xs v
buildDatabase :: String -> FreshDatabase -> FreshDatabase
buildDatabase range db = processRange range : db
freshIngredients :: FreshDatabase -> [Int] -> [Int]
freshIngredients db = filter (isFresh db)
parseDatabase :: String -> FreshDatabase
parseDatabase = foldr buildDatabase [] . lines
parseIngredients :: String -> [Int]
parseIngredients = map (\x -> read x :: Int) . lines
parseInput :: [String] -> (FreshDatabase, [Int])
parseInput [a, b] = (parseDatabase a, parseIngredients b)
parseInput _ = error "Wrong input!"
part1 :: IO ()
part1 =
getContents
>>= print . length . uncurry freshIngredients . parseInput . splitOn "\n\n"
data RangeEvent = StartEvent | StopEvent deriving (Eq, Ord, Show)
rangeCoverage :: [Range] -> Int
rangeCoverage =
(\(_, _, _, c) -> c)
. foldl countCoverage (0, 0, 0, 0)
. sort
. concatMap (\(s, e) -> [(s, StartEvent), (e, StopEvent)])
where
countCoverage :: (Int, Int, Int, Int) -> (Int, RangeEvent) -> (Int, Int, Int, Int)
countCoverage (_, lastEnd, 0, coverage) (start, StartEvent)
| start == lastEnd = (start + 1, lastEnd, 1, coverage)
| otherwise = (start, lastEnd, 1, coverage)
countCoverage (lastStart, lastEnd, n, coverage) (_, StartEvent) = (lastStart, lastEnd, n + 1, coverage)
countCoverage (lastStart, _, 1, coverage) (end, StopEvent) = (lastStart, end, 0, coverage + ((end + 1) - lastStart))
countCoverage (lastStart, lastEnd, n, coverage) (_, StopEvent) = (lastStart, lastEnd, n - 1, coverage)
part2 :: IO ()
part2 =
getContents
>>= print . rangeCoverage . fst . parseInput . splitOn "\n\n"
main :: IO ()
main = part2

135
2025/aoc/inputs/day4.txt Normal file
View file

@ -0,0 +1,135 @@
@@@@..@@@.@@@@@@@@@.@..@.@@.@...@@.@.@@@.@@..@@.@@@@@@....@..@@@.@@.@@@@@@..@.@.@@.@.@@.@@@@.@@@@..@.@@@@..@.@...@@..@..@@@.@@@@.@.@@@@
.@@.@.@@@..@..@@@@.@.@@@@...@@@@@@@..@@@.@.@@@..@.@@@@@@..@..@@@@.@.@@@.@@@.@@.@@@@..@@@@@@@...@@@@.@@@..@@@@.@@...@@@.@.@.@@@@.@@@..@@
@..@@@@..@@@.@@@.@@@.@@@@..@..@....@@@@.@.@@..@.@@....@@@.@@@@@@@@.@@@@@@@.@@@.@@@@@@@.@@@@@@@@@@@@@@.....@@.@@@@@@...@@@.@@.@.@@@...@@
@..@@...@@@.@..@@@@@@@.@@@@...@@@.@@@@@.@@.@@.@@..@@@@@@@.@@.@.@..@.@.@@@@@@@.@..@...@@@@@@@..@@@..@@.@@.@...@@@@@@.@@...@@..@@@.@@.@.@
@@@@@.@@@@.@..@@@@..@.@..@@@@@@@@@.@..@.@.@.@@@..@@@.@@@.@@.@@@.@@@.@....@@..@@@@@@.@.@@@..@.@.@.@.@.......@@@@@....@@@@@.@@.@@@@@.@@.@
@@@@...@..@@.@.@..@@.@.@@@.@@@@@.@@@@.@@.@.@@...@@..@..@..@@@@@@@@@.@.@@@@@@@.@.@.@@@@@.@..@@@@...@..@@@.@..@..@@@@@..@@@@@@@.@@.@@@@@@
.@..@....@@@@@@@@@@@@.@@@..@@@.@.@@@@@@@.@.@@.@...@@..@.@@.@@@@@..@.@@@.@..@@.@.@....@@.@@@@@.@@@@@.@@@..@@@@.@.@@@@..@.@..@@@@@.@@@@@.
@@@.@@.@..@.@@@@@.@..@@@@.@..@@@@@@@..@@@.@@@@.@@@....@@@@.@..@@@.@.@.@@.@.@@..@@.....@.@.@@@.@@@@@@@@..@@@@@@@@.@.@@@@@@.@...@@@.@..@@
@.@.@.@@...@.@@@.@...@.@@@@@.@@@.@@@..@@@.@..@@.@@@@@@@@@....@@@@@@@@@@@@.@@..@@.@@.@..@.@@.@.@@@.@.@@@@..@@.@@..@..@.@..@@.@@@..@@@..@
@@@.@@@@@@@@@@@@.@@..@.@@@.@.@@.@..@.@@@@@....@@@@.@.@@@.@@.@@@..@@.@@@@@@.@@@@.@@@@..@.@@.@@.@@.@@@.@@@@.@.@@@@.@@.@@@@..@...@@@@...@@
@@@@@@@.....@.@@@.@@..@@@.@@@@@.@@@@@@@@@@@.@@@.@..@@.@.@@.@.@@@@..@@...@@@@@.@..@@@@@.@...@@@@@@..@@@.@.@.@@@@..@.@@@@@@.@@.@@@..@@.@@
..@@@.@@@.@@@@@@@@.@@@.@@..@@@@.@.@@@@@@@@@.@@@@@@@@@...@@@...@@@..@@@@@@.@@@.@@.@@@@.@@@.@@.@@@@..@@.@@@@..@@@@.@.@@.@..@@.....@@@@@@.
@@@@@@@@.@@..@..@.@@@@@@.@@@@@..@@@..@@.@@@@@.@.@@@.@@@@@.@@@.@..@@@@@@@@@.@@@@.@@@@.@@@@@@@@@@@@@.@..@@@@@@.@@@..@..@@..@.@@@@@.@..@@@
@@@@@....@@@.@.....@@@@.@@@@@@@@@.@.@@@@@@.@@@@@..@@@@.@@@@.@@@.@@@@@@@.@@.@.@...@.@@.@.@@@@@.@@..@@.@@@.@@@.@@.@...@@@@.@@@...@@@@@@@@
..@@@@.@@@.@@@....@@@...@@@@@@@.@@@.@@.@@@@.@@...@@.@@.@@@.@@@@@@@..@@...@.@@.@.@...@.@@.@@@@@@@@.@@.@@@@.@@.@@.@@@...@...@.@@@@@.@....
@@.@@@@..@@.@..@@.@@..@@@@.@@.@@@.@.@@@@.@@@@@.@..@.@@.@@.@@..@@.@.@@@..@@@@.@.@@@@.@.@@@.@@@.....@..@@@@..@..@.@@@@@.@@@.@..@@@.@@@@.@
@@@@@@@.@@@@@...@@.@.@.@..@.@@@@@@@@.@@@@.@@@.@@@...@@.@@.@@@.@@.@..@@@@.@.@@.....@@@@@@@@@@@.@@@@..@@@@....@@@..@.@@..@@.@..@.@@@@@@..
@..@@..@@@...@@..@.@..@@...@..@@@..@@@@@.@@@@@@.@.@@@@.@...@...@@@...@@@..@@@@.@@@@@....@@@@@@.@@@..@@@@@@.@@..@@@@@@@@@@@@.@@@.@@@@@.@
...@@@@...@.@@@@@.@.@@@.@@@@@.@@@@..@@.@.@@@@..@@.@@@@@@@@@@@@@@@.@.@..@@.@.@@@@@.@.@@@.@@..@@@......@@@.@@.@@@@@@.@@@@@@@@@@.@....@@@@
.@@@@.@@@@@.@@@.@@....@@@.@@@@@@.@.@@.@@@.@@@@..@..@.@@..@..@.@@@@@.@@.@.@@@@..@@@@@@@..@.@@@@@.@@...@@.@.@@@.@@@@..@@@@@@.@....@...@@@
.@@.@...@@@@@..@@..@@@.@...@@@@...@..@..@.@.@.@@..@@@@@..@.@.@@.@..@@@..@@@.@@.@.@@@@@@@@.@@@.@@..@@@@.....@@@@.@.@@@@@@@.@.@@@.@@....@
.@@@.@@@.@.@.@@@@..@@@@@@@..@@@.@@...@@@.@..@@..@@..@@@@..@.....@@@@.@..@.@@.@..@@@.@@@@@.@@@@@.@@..@@@.@@.@@@@.@@@..@.@@.@.@@@@..@..@.
.@..@..@@@@.@@.@@...@.@@@@@@.@....@.@@@@...@@@@@@@.@.@.@.@..@..@@.@.@..@.@@@@@@@@@.@@@@@@@@.@@.@.@@@@@.@.@@@..@@@@.@@@@@@@@.@@..@.@@...
.@@@@..@@@.@@.@..@@@@@@@@@@@@@..@@...@.@....@..@.@@@..@@@@@@@@@@@....@@.@@.@@@@@@@.@.@@@@@@@@.@@@@@@@@@@@@@@@.@..@@.@@.@..@.@@@@@@.@@@@
..@.@@@@@@@..@@.@.@.@@@.@.@..@@..@@@@@@@...@..@@@@.@@@@@.@@.@.@@@@..@@@@@@.@@...@.@...@@...@@@@@.@.@@@@@.@@@....@@.@@.@@..@@@@@.@@@@@.@
@@@@@@.@.@@@@@@@@@@@@.@@@@@.@..@@@.@.@@@@@@@@@@@@@@.@@.@.@@.@@@@@@@@...@@@@@@@.@@@@..@...@..@@@@@@@@.@...@@@@@..@@.@@@@@..@..@@@.@@@@@@
@@.@.@.@@..@@@..@@.@@@@@.@@..@@@@...@@@@.@@@.@@..@.@@@@@@@...@@@@..@@@@.@@.@@@@.@.@.@.@@...@.@.@@.@.@.@@@@@.@..@@.@@@@.@@@.@@.@@.@.@.@@
@@...@......@.@.@@...@@@.@@@.@@.@@.@@..@@..@@@@@.@.@@@@.@..@.@.@.@@@@@@@.@@@@@@@.@@@@@@@@@@.@@@@@.@...@@@...@@@@@.@@.@.@.@.@.@@@@.@@.@.
@@@@@@.@@.@..@.@@@@.@@@@@.@@.@...@.@@..@.@@.@@..@@@@@@@@@@.@@.@.@@@@@@@@@.@@@@@@.@.@@@@...@@@@.@@@..@..@...@...@@@@@@@@.@.@@.@@.@@@..@.
....@@.@..@...@..@@@@@@.@..@@@@@@@@@..@@@@@@.@.@.@@@.@@@@@.@....@@@.@.@@@@@@@.@@@@@@..@@..@@@......@@..@@@@@@@@.@@..@@...@@@.@.....@..@
@@@.@@@@@@@@@..@.@@@@.@@@@..@@@@@@@@.@@.@@@@@..@@@@@@..@.@@@.@.@@@@@@@@@@.....@@..@.@@@@@@@@@@@@@@...@@.@@@@.@....@@....@.@@..@@.@.@@@@
.@@..@@@@@@.@@@@.@@@@..@@@@@@..@.@@@...@@.@@.@.@@@.@@@@..@@.@@@@..@@@.@@.@...@....@..@@@.@@@..@@@@@@@...@@@@@..@@.@.@@@@@@.@@@@@.@@.@@.
...@@@.@@.@@@@@....@@.@.@@@@@.@@.@@@...@.@@.@.@...@@@....@@@@.@@@@@@@@@.@.@.@@@.@@@@@@.@@@.@.@.@..@@@@@..@..@@@@@@@@.@.@@.@@@@@@.@@@@.@
@@@....@...@@@@@.@...@@@..@@....@@....@@@@.@@@@@@...@@@@.@@@@@@@.@...@..@@.@..@@......@@@@.@@@.@.@@@@..@@.@@@@.@@.@@.@@@@@@@.@@@@@@.@.@
@@@@@...@@.@...@@@...@@@@.@.@.@@@.@@...@@@..@@.@..@..@@@@@@@@.@@@.@.@..@.@..@@@@.@.@@@@@.@..@...@@...@@.@.@.@@.@.@@..@.@@@....@..@.@@@@
@@.@@@@..@@@@..@..@@@@.@.@@@@...@@@.@..@.@@@..@@..@.@....@@@@@@@.@@@@.@@@@@@@@@@@@@@.@..@@@@@...@.@....@@....@@@.@@@@@@@.@.@@@@.@@.@.@@
@.@.@@@..@@.@..@..@@@@.@.@@..@..@@.@.@@@.@.@.@.@@@@.@@.....@.@@@@.@..@@@.@@@@.@@@@@@@.@@@@@.@@@...@@.@@...@@@@@@@@@.@@.@@.@.@@.@@@@@@@.
@@@..@@@@@@@..@@.@..@.@@.@.@@.@@.@@.@@.@@@.@@..@@@@@@.@@@@...@.....@@@...@@@@@..@@..@.@@@.@.@@.@@@@.@@@@@.@@@@.@@.@@@@.@@@@@.@@@@@@.@.@
.@@@@..@..@.@...@.@@@@.@.@..@@@@@.@.@@.@....@.@@.@...@@@@@@@.@@@...@@@@..@@@.@.@@@@@@.@.@@@@@@@@@...@@@@@@..@@@..@.@@@@@.@@.@@@@@@@@...
.@@.@@@@@@.@..@.@@@@@@@.@@@.@.@@@..@@..@@@@@.@.@..@@.@@@@.@@@.@..@@@@@@.@@...@@@..@@..@.@.@..@@@@@@.@...@@@.@@@.@@..@@@...@..@...@@.@@.
.@@@@@..@.@...@@...@@@.@@@@@@@.@@@@@@@@.....@@@@@@@@@@@.@.@.@.@@@@.@@@.@.@..@@@@@@.@@@@@@....@@.@@@@.@@@@@@..@...@@.@@@@@@@.@..@@@.@@@@
..@@@@@@@@@.@@.@@@.@@@@@@@..@@@@@.@.@@@@@@....@..@..@@.@@@@.@@@@@@@@..@@@..@@@.@@@@@@@@.@.@.@@@@.@@@@@...@@.@@@@@..@@@@@@@@@@..@..@@@@@
@@@@@@@..@@.@.@@..@.@@@@.@@@@@.@.@@@@@@.@@@.@@.@@@@@@@@..@.@.@@@@.@@..@@.@@@.@@.@@@@@....@@@.@.......@...@@@@@..@@@...@@.@@.@@.@.@@@@@.
@@@..@.@@@....@.@@@@@@@@.@@..@..@..@@.@.@@.@.@@@.@..@@..@.@.@.@.@@...@@.@.@@.@.@@....@.@@@.@@@@.@.@@@@@@@..@.@..@@@..@..@@..@@@@@..@@.@
.@.@.....@.@@@..@@.@@@@@@@.@@.@@.@@@@@@@@.@@@@..@@.@@..@@..@.@.@@@..@@.@@@@@@.@@...@..@@..@.@.@.@@@.@@.@.@@@@@@.@.@@.@@@..@@@.@@..@.@@@
@...@@..@@.@..@@.@..@@@...@@@@@@.@@.@..@@.@@.@@@@@@@@..@@.@@.@.@@.@@.@@@@@.....@@@.@@..@@@@.@.@@@@@.@@.@@..@@.@.@@.@@.@.@@@@@@.@@@@.@@@
@@@@.@...@.@...@.@@@@@@@@@...@...@@@.@@@@@.@@@@@@.@@.....@@.@..@.@@@@.@@...@.@@@@@.@@@@@@@@@..@@@@@@@..@......@@.@@.@.@@..@@.@@@@@@.@@.
@@.@.@@@@@.@@@.@@@@@.@@@@@.@.@..@.@@...@@....@.@...@@@...@.@..@@@@.@.@@@@@@.@.@.@.@@@@@@..@@.@@.@@...@..@@@.....@.@@.@@@@..@@..@@.@.@@.
@.@@@@@.@.@@@@@.@@@@@@.@.@@@.@@.@....@....@@....@@@@@@@.@@@@@.@@@@@...@@.@@@@.@@@.@@...@@.@@.@@..@@@@.@@@@@.@.@.@..@@@@@@.@@@@@.@.@.@@@
@@.@@@@@..@.@@..@@@@@.@.@@@@@@@.@...@.@@..@..@@..@@@@@.....@@.@.@@.@@@@.@..@@..@@@.@....@.@.@@@.@@@.@@.@@.@.@@@@.@@@..@....@.@@.@.@.@..
@@@@@.@@.@@@@@@@@@@..@@..@@...@.@...@@@@.@.@@@@@@@@@@@@.@@.@...@..@@.@@..@@@..@.@...@@...@@..@@@..@..@@..@@@.@....@@@...@@@.....@.@@@@@
@@@@@@@.....@.@@.@@@@@.@@@@@..@@@.@@..@@@@@..@@@.@..@..@@@@@@@@@@@@.@@@.@.@@@@@..@@@@...@@@@@.@@@@@@@@..@@.@..@.@@....@..@.@@..@@.@@@@@
.@@.@@@@@@@.@.@@@..@.@@@.@.@@.@@@.@.@@@@@@@@@@@@@@@..@@@.@@.@@@@@..@@.@.@@@.@@@@@@@.@@.@.@@...@.@@...@@@.@.@..@.@@.@.@@@@.@@@@@.@@@...@
@@@@@@@.@@@..@@.@.@@@.@@@@@@@@@..@.@.@@..@@@@.....@@@@.@...@@@.@@@..@@..@@..@@.@@@..@@.@.@@@@.@@.@@@.@@@.@.....@@@.....@@@@@@@@@.@@@@@.
@@.@..@.@@.@@......@@..@@@..@@...@.@@@@@@.@@.@@.@..@@...@@..@@@.@..@@@@@@.@.@@...@.@@@.@@@@.@@..@@@@@@@.@.@@@...@..@.@@@@..@@...@@@...@
..@@@@.@..@@....@.@....@@@@@.@@..@@@@@.@..@@@@@@..@@@@@@@.@.@@@.@@.@@@@@@@..@.@@@@.@..@@@@@@@...@@@..@@@@@..@@@.@@..@@.@.@@.@@.@@@.@.@@
@@.@@.@.@@@.@.@.@..@@....@@@@@.@@@@.@@@@.@@@@.@@@@@@.@@@@...@@@@.@@..@..@@@@.@@@@..@@.@.@.@@@.@.@@@@@.@..@@@@.@.@@.@@.@@@@@@@.@@@@@@..@
@@.@@@.@.@.@@@.@@.@@@@..@@..@@@@@@@.@@.@.@@.@@@.@..@@@..@@@@@@@@..@@@@.@@@@.@@@.@@.....@@..@@@@@@@.@@.@.@.@@@@@..@@.@@.@@@@.@@.@@@@...@
@...@@@@.@@@@@@..@...@@@@@.@@@.@@@..@.@@.@@@..@.@@@@..@@@@..@.@@.@.@@@.@.@@...@..@@.@.@.@@.@.@@@@.@@..@@@@.@@.@@..@.@@@.@@@.@@@@@@@@@@@
.@@@.@@.@...@..@.@@.@..@@..@.@@@@@@..@@@.@@@..@..@.@@@.@@..@@.@.@@@.@@@.@.@.@.@.@@.@.@..@.@@@.@@@@@@.@...@.@@@.@@@.@.@.@.@@.@@..@.@@.@.
@@@@...@@@@.@@.@.....@@@@@@.@..@@@@@@@@@@.@..@.@@@@..@@@@@..@@.@.@@@@@..@.@@...@.@.@.@@..@@@@@.@..@@.@.@@.@.@.@@...@@@@@.@@..@@@@.@@.@.
@.@@@.@.@..@@.@.@.@.@.@@@@@@.@@@@@@@@@.@@@@.@@@@.@@.@@@..@@@@@@@@@@@@@.@@@@@@..@.@@@.@..@@..@@@@.@@.@..@.@@.@@@@@@@.@.@@@@@.@.@@@@@..@@
@.@@@@@@.@.@.@@.@.@@..@@@..@@.@@@..@@@@@@...@.@..@@@@@@.@...@@@.@..@.@@@@@@@.@@@@..@.@@.@.@..@@@@@@.@@@@.@.@@..@...@.@@.@@@.@.@@@.@@.@.
@.@@..@.@.@@@@@@@@@..@@@@...@@@@@@@.@@@.@@.....@.@....@.@@.@@@@@...@@@...@@..@@@....@@@..@@@@.@..@.@.@.@@@.@@@@@.@..@@.@.@@@@@@@@@.@@.@
@@@@@@@@@@@.@@@@.@@.@@.@@@@.@@@@......@@@@..@@@.@..@@@.@@@.@..@.@@@@.@@..@@@.@@@....@.@@@.@..@@@@@.@@..@@@.@@@@@.@@@@@.@@@@@@@.@@@@@@@.
@.@@@@.@@.@.@@@@@@@@@.@@@@@@.@@@.@.@@@@@@@.@@.@@.@....@@@@@.@@..@@@@.@.@.@@@@.@.@@.@@..@@@@@.@@@@@@@.@....@@@@@@@.@.@@@@..@.@@@@@@@@@.@
@..@.@.@@@@@@@@..@@@@@@.@.@@@@@..@@@.@.@..@@@.@.@.@@@.@@@..@@@@@.@@.@@@@@@.@@.@@@@@.@@.@..@@.@@@..@@@@@@@..@@.@..@.@@@@@...@@.@@@@@@.@@
..@.@@@@@@.@@@@@.@.@.@.@@@.@@@@@@.@.@@@@.@..@@@.@@.@@..@@@@@@@@@@@.@.@@@.@@@.@@.@@.@@@.@@...@@@@@@@..@.@@@@..@@@.@@@@.@@@@@@@@@@@@@.@@@
.@.@@.@@@.@@.@@.@@@@.@@..@@.@@@@@@@@@.@.@.@.@@@@@.@@@..@@@..@.@@@@@@@..@.@..@.@@@.@.@@.@.@...@@..@@@.@@....@@@.@@@@.@@.@@.@@@...@@@@.@@
@@@@.@.@@@.@.@...@@@@@.@.@@..@..@@.@@@.@@@@.@@.....@.@.@@@@....@@.@@.@@@@@.@@@@@@.@@@@@.@@@...@.@.@@.@..@@@@...@.@@@@@.@@@@@@..@.@.@@@.
...@@@..@.@@@...@@@@@@.@..@.@@@..@@.@@@@@@.@@@@@.@@.@@.@.@.@.@..@@@@@.@@.@.@..@@@@@@.@@@@@@.@@.@.@@@@@@.@.@.@@@@@@@..@.@@@.@@...@.@...@
@@@@.......@@..@@@@@.@@.@.@@.@@@.@.@@@@@.@.@..@.@..@@@@@@.@@@.@.@@@..@@.@@...@@@@...@..@@@@.@@..@@@@@@@.@@@....@@.@@@@@@.@@@@@..@@@@@.@
@.@.@@@..@@@@@@...@@.@@.@.@.@.@...@.@..@@@@@@@.@.@@@@@...@.@@@@@.@..@@@@@.@@@.@.@@@@.@..@.@@@@.@@@@.@@@@.@@@.@@@@@.@@@@@..@@.@@@..@.@@@
@@@@.@...@@.@@@@@..@@@..@.@@@.@@..@@..@@@@.@@..@@@.@.@@.@@..@.@@@@@@@@@@.@@@@.@@....@..@@.@@..@@.@....@..@@@@@@.@@.@.@@@.@@@.@.@@@.@...
.@...@.@@.@@@@.@@@@@.@@@@.@.@.@.@..@....@@@@@@@@@.@@.@@@@.@...@@@.@@@@@..@..@..@@@@@@.@.@..@@..@.@@@..@@@.@..@@@@.@@....@@@@.@@@@.@@.@.
.@.@.@..@...@.@@@@@.@@@@@@@.@@@@@.@.@@.@.@.@@.@@@@@@.@..@.@@@@.@@.@..@@@@@@.@@.@@@@@@...@...@@@@..@@.@@.@@.@@@.@@.@@@@@@@@@.@@.@@..@@.@
@.@@@@@@@@@@@.@@..@@@@@..@.@.@@@..@@@@@.@.@@@@@@@@@@@.@..@@@.@..@@@.@@@@@@.@..@.@@.@@@@.@@..@.@..@..@@@.@@@@@@@@@@.@@.@@@@@.@@@@...@@..
@@.@@@.@.@..@@@@@@@@.@..@@@..@.@@@@@.@@@@@..@@..@@.@@.@.@@.@@@@.@.@.@.@@@.@.@@.@@.@.@.@@.@@@@..@@..@@.@@@@.@..@@@.@@.@@@@@.@@@@.@..@.@@
@@..@.@.@@.@@..@@@..@..@@.@@@..@@@@@.@@@@..@@@.@...@@@.@..@.@@.@@..@@@.@@@@@@.@.@@@.@@@@@.@.@@@.@.@@@..@@@.@@@.@.@@@...@@@@@.@.@@@@..@@
.@@.@.@@.@...@@.@@@@@.@@@@@..@@@.@@@..@@.@@@.@@@@..@@@.@@@.@.@...@@@@@.@@@@@.@@..@@.@@@...@@.@@@.@@.@@@@.@@...@@@@@@@@.@@@..@.@@.@...@.
..@.@.@@.@.@@@.@@@@.@@@.@@.@@.@@@...@.@.@.@@@@@@@@@..@.@@.@@@@@.@.@@@.@@@@@@.@@@.@@..@@.@..@.@..@@@@.@@.@@@@.@@..@@.@.@@@@@@.@@.@.@.@.@
@.@@@@@@..@@.@@.@..@@.@..@.@@..@@@..@.@@..@...@.@@@@@.@@@@@..@@.@@@.@.@.@....@@.@@@.@.@@@@.@@@@@.@..@.@@.@.@..@@@@.@.@..@.@@@.@.@@@.@@@
@..@.@@@@@@..@@@@@.@@@.@@@.@.@@.@..@@..@@@...@.@@@.@@@@.@@.@.@@.@.@@@@..@@@@@..@....@@@.@@@.@@@@@@@@@@@.@..@@@@@@@@@@@.@..@.@.@..@@@@..
.@.@.@.@.@@@.@@@@@@.@@..@@@@@@@......@.@@@.@.@..@@@.@.@@@@.@@.@.@..@@.@@.@@..@..@@@@@.@@@@@..@@.@@@@.@@@.@@@...@.@@@@@@..@.@@@.@.@@@..@
@@@@.@@..@.@@.@@@..@.@@@@.@.@.@.@.@@@@....@@@.@@@.@.@.@@.@..@...@.@@.@@@...@.@@..@..@.@@@.@.@@@..@@.@.@..@@@@..@@@.@.@@@@@.@@@.@..@@@..
@@@@.@@..@@@@@.@..@@.@@..@.@@.@@.@@.@@@.@@@@@@.@@@@@.@@.@@.@@@@.@@@@@@.@..@.@@.@@@@...@.@@@@@.@.@@@..@@....@@.@@.@@@@.@@..@@@.@@...@.@.
@.@@.@.@@@@@@.@.@@@@@@@@@.@...@@@@.@@.@@@@@...@@.@@@.@@@.@@.@@@..@@@@.@.@@@@@@@@.@...@.@@@.@@..@@@.@......@@@..@@.@@.@@@@@.@@@@@@.@@@@@
..@@@@@@..@@@...@.@@.@@@@@@@.@@@@@@.@@..@.@@@.@@...@@.@@.@..@@..@@@@.@@..@@.@.@@@@@@.@@@@@@@@.@@.@@@@@@@@@.@@.@@.@@..@@.@@.......@@..@@
@.@@.@@@@.@@@@@@@...@.@@@.@@.@.@.@@@@.@@@@@.@@..@@@@.@..@@@@@@...@@@@@@@@@..@@@.@@@...@@@.@..@@@@@@.@@.@.@..@.@@.@@@.@.@@@.@@@@@@.@.@@@
..@@.@@..@..@@@@@..@@@@@@@.@@@.@@@.@@.@..@..@@.@.@....@@.@.@.@@@.@@..@@@.@@@@@@@@@@@@@.@.@...@@@.@@.@@..@.@.@@@..@@@@@.@@@@...@@@@@@@@@
..@.@.@.@@@@@.@.@@@@.@...@@@.@@@@@@...@@.@@.@..@..@.@...@...@@.@..@@.@..@@..@.@@.@@..@@@@@@@.@@@..@.@@@@@@@@@@@..@@@.@@@..@@@@@.@@@@.@@
@..@@.@@@.@.@@@@.@@@@@..@@@@@@.@@@@.@@@@@.@@@.@@.@@..@@@@@..@@@@@..@@@@@@@@@.@...@@@..@@.@@@@@@.@.@@.@..@.@..@.@@..@....@@@..@@@@.@@@.@
..@@@@@.@@@@@@@@..@@@.@@@@.@@@..@@.....@@.@.....@@@..@.@@@@@@..@.@@@...@@@..@.@@@@@@@@@@.@.@@@..@@.@@.@.@@@@@@..@..@.@..@.@..@.@.@@@@..
@@.@@@.@..@@.@@..@@...@@@.@@@@@@@@@..@@.@@@.@.@@...@@@@@.@@.@@@@...@@..@@@...@..@@@@@@...@..@..@.@@.@@@...@@@@@@..@@@@.@@@...@.@@@.@@..
@...@@.@@.@@@.@@.@@@@@@@@@.@@.@@@@.@@@.@@.@.@.@.@@@@@@@@.@.@...@@@@@.@@.@@.@@@..@@..@@...@@@@@.@..@@@@....@@@@.@@@@@..@@@@@@@..@@......
.@.@@..@@..@@@@@@.@.....@@@@@.@.@@.@...@.@.@@@.@@@.@..@@...@@@@@@.@@@@@...@..@@@@@@@@.@@@..@@@@@@.@@@.@..@@@@@@@@.@...@@..@@@@@....@@@.
@@@.@@@@.@..@@@.@@@@@@.@@.@@.@.@...@@@.@@@@.@@@@@@..@@@.@@@@@.@@@..@@@@@.@..@@@@@@@..@@@@...@@@..@@@@@@@@@@@@@.@.@@.@@@@.@@@........@..
@.@@@@.@.@@@@@@@@@@@@.@@.@@@...@@.@@@.@.@.@@@@@@@@@@@...@@.@@.@@.@@.@.@@@@.@@@.@.....@@@@..@...@.@.@@@..@@@..@@@@..@@@..@.@@@@.@.@.@@@@
@@.@@@.@@@...@@@@@..@.@@@...@@@@@.@@..@.@.@.@@@@.@@.@@.@@@@@@@@@....@@@@@.@@.@.@@@@.@.@@@....@@@.@@@@@.@@@@.@@.@@@....@@..@@@@@..@@@@.@
@...@@@.@..@@@.@@@@.@@@.@.@@..@@@@..@.@@.@.@@@@@.....@@@@.@@@@@@..@@@.@@.@@@@@@@..@@@@.@@@@@..@@..@..@@@.@@@@.@...@@.@.@.@...@@@@.@@.@@
@@.@@@@.@@..@@@@@@@@@@@.@@@@.@.@.@@@.@@@@@@.@@@@.@......@@@.@@@@@@@@..@@@@@@.@@.@@@@@...@@...@.@@@..@.@@@@@@.@@@@.@@@@@.@.@@@@@.@@@@@@.
@..@..@@.@..@@....@.@@@..@@@.@@@@.@@.@@@@@@@@@@..@@@@@@@@@@@@@..@@@@@.@@..@@@@@.@@@@@@@@@..@@.@@@..@..@@@....@@.@.@@@@@@@...@..@@.@@@.@
...@@..@@..@.@@@@@@@@@@.@@.@@@...@@@@.@@@.@@.@@@@....@@@@@.@.@@.@.@@.@..@.@@@@@@@@@@@.@@@.@@@@..@@@..@@.@@.@@@@.@.@@@@@@@@@.@@@@.@.@@@@
@@@@@@..@@@@@@..@@@@@@.@@@.@@.@.@.@@@@@.@@..@@@@@...@@@@.@@@@@@..@.@@@@@@@@@@@.@@@.@@.@@@@@@@@..@@@.@@@@..@.@@.@.@@..@@.@@@..@@@@@..@@.
..@@...@@@@.@..@@@.@@.@@@@@@@@@@.@@@..@@.@@@.@.@@.@@.@@@.....@.@.@@.@......@.@.@@@.@@@@@@@@....@@@@@@...@..@@.@@@@...@@@@@.@@@@.@@@@.@.
.@@@@.@@...@@.@@.@..@@@@..@@.@@@.@@@@@@..@@@@@..@@@@@..@.@@..@@@.@.@.@@@.@.@@....@@@@@@..@..@@@@.@@@@..@@@@@@.@.@.@.@@.@@..@@...@@@@..@
@@@@@.@@..@.@@@@@@...@....@.@@@...@.@@@@.@.@@@@@@@...@@@.@@.@@.@@@@.@.@@..@..@.@.@@@...@@.@.@@.@..@@...@@@.@@@.@@..@@.@@@@@.@.@@.@@.@@@
@.@.@.@@@@@.@..@..@@.@..@@.@@@@@..@.@.@@@@@..@@@@.@.@@@@.@@@.@..@@@@@@@@@@@@@.@@.@.@@@.@@@@@@...@@@.@@.@@@@@@.@@@.@@.@@@..@@@@@@@@.@.@@
@@@..@.@.@@@.@@..@@@@.@@.@@.@@@@....@@..@.@@@@..@.@.@.@.@.@@@@@.@@.@.@@..@.@.@.@@@@@@@....@@@@.@..@.@@.....@@@@@@@@@..@..@@.@....@@@@@.
@......@@@@.@@@@.@...@..@@....@.@...@..@@@.@@.@@@..@@.@..@.@..@@.@..@@...@..@@...@@@@@@@@.@.@@@@@@@..@@..@..@.@@...@...@@@.@@@@@.@@.@.@
.@..@@.@@.@@..@@@.@.@@@@@@@@@@@@.@@@@@@.@@@@@@@@@@@@@.@..@@.@@@@.@@@@@.@@@.@.@@@@@@@..@@@@.@@@@...@@@..@@@@.@.@..@@..@@@@@.@@@.@@@.@@@.
.@@@@..@.@@@@@...@@.@@@.@..@@@@@@@.@@@.@.@.@@@@@@@@..@@@@.@@..@@@.@@..@@@.@@....@@@@@@@@@@@@.@@@@.@.@@@@@..@.@@@@@@@@@@..@@@..@@@.@.@.@
@@.@@@@@@@@@@@@.@@@.@@@@@@@@.@.@.@@@@@@@@@.@@.@@@@@..@@@@@@...@@@@.@@..@@.@@@@@.@@...@@@@@@.@.@@@@@@@.@.@@@@@..@.@.@@@@.@.@@.@@.@@@@..@
@@@.@.@@...@@.@@@@@.@@@@@..@@@.@.@@..@@@.@@.@..@@.@.@.@.@.@@@@@@@@@@@@@@@..@@@@@@@..@.@@@@@@@@.@@.@@@..@@.@.@@..@@.@@@..@@@.@@@@...@@.@
.@@@...@@@.@.@@@@@@@@.@..@@...@@.@@..@...@@@.@@@@.@@@@@@@@@.@@.@@.@@..@@@.@@@@.@.@@@@@@@@@.@..@@.@.@@@@@@@..@@@@@@.@..@@@.@@..@.@@@@...
..@@.@.@@@.@@@@@@@@.@@@@@@@@@@@@@.@.@@.@.@..@@@@..@@@@.....@@.@@@@@@@...@@@@.@@@@@.@@..@@@.@@@@..@@.@@.@@.@@.@@.@.@.@@.@@@@.@@@@@..@..@
.@@@@@@@@@@@@@.@@@.@@@@.@@@@.@@@.@@..@@@@@.@@@@@@...@@@.@@.@@..@...@@@@.@@@@@.@@@@@@@@@@@@@@@.@@@..@@@@@..@@..@.@.@.@@@..@@@...@@..@@..
@.@...@@@@@@@@@@@@.@@@@@@@@@@@@@.@@@.@.@@@@@...@@.@@@.@@@@.@@...@@.@.@@@..@..@@@@@.@@.@..@.@@.@@@@@@@..@..@.@@@@@@.@@@.@@...@@@.@@@@@@@
@@.@.@@@..@.@@@@.@@@@.@@@@.@.@..@@....@@@@@@@@@@.@@.@@@@@.@..@.@@.@@@@@@@@@@@@@@@.@@@@..@@@@@.@@.@@@.@@@..@.@@.@@@@@.@@@.@.@.@.@@.@@@..
.@..@@@..@.@.@.@.@@@@@@@@@..@..@@@@@@@.@@@.@..@.@@......@.@@@.@@@@@.@.@@.@...@@@@.@@.@@.@@.@.@@.@@@@@@.@@@@...@@@@@.@.@@.@@@@@.@@.@@@.@
@@.@.@@.@@@@@@@@@@@@@...@.@.@@@.@..@@.@@.@..@@@@..@@@@@@@@@..@.@@@.@.@.@@..@@@@@.@@@....@...@@@@@@...@@@@@@@@.....@@@@..@.@@.@.@@@..@@@
@.@@@@@..@@@@..@.@@@@@.@.@.@@.@@@@@@.@@@.@@@@@@.@.@@@.@.@@@@.@@.@@@@@.@@@@.@@@@@@@@.@@...@@@@@@@@@@@.@@@.@@..@@@@.@@.@@@@.@@@@@@@@@@@@@
.@@@..@..@@@@@@@@@@.@@@@@.@.@..@@@.@.@@@@@@.@@@@@...@@.@@@@.....@.@...@...@@@@@@@@@@.@..@@@@@..@@@@.@@@.@@...@.@@@@@@@....@@@@..@@.....
@..@@..@.@@..@@@@@..@.@..@.@.@.@@@@.@@@.@.@@@.@@@@@.@@@@@.@.@@@.@.@@@.@...@@@@@.@.@@@@...@.@@@.@.@@.@.@.@@@@@@@@@.@@@@@@.@...@@@@.@.@@.
@.@.@@@@@@@@.@.@@..@..@@@@@.@@@@@@...@@@@..@@..@@@@.@@.@@.@@.@...@@...@..@.@@@.@.@.@@.@.@@@@...@@@@@@@@@..@@@@..@@@@@@@@......@@@...@..
@@.@@@@@.@@@@..@@.@.@@@..@.@@@.@@@@.@@@@@@@.@.@@@.@@@....@.@@@@@@..@@@.@.@@.@.@@.@@@@..@@@@@..@@.@@@@.@..@@.@@@@@@.@@.@.@..@..@.@@..@.@
@@..@@@.@..@..@@@@@.@@.@@@@@@.@..@..@@@@..@@...@@@.@@.@@..@@@@.@..@@@..@@@..@@@..@@@.@@...@@@@.@@@@.@@@@...@@@.@@@.@..@@@.@@.@@@.@@@@@@
.@.@.@@@@@@@@@..@@@@@@..@@.@..@@..@@@..@@@@@.@@@.@@.@.@@@@.@.@@@@@@@.@@@@@.@@@@@@@@..@..@@@@@@@@.@@@.@...@@.@@@.@@.@@..@@@@@@@@@@@@..@@
@..@..@@@@.@.@.@.@.@....@.@@@..@@@@@@.@@.@@..@..@..@@.@..@@@@@..@@.@@@@@..@@@@@@...@@..@@@@@.@....@@@..@.@.@.@.@@@@.@.@@@.@..@@@@@.@.@@
@@...@@@.@@.@.@.@.@@.@@@@.@@@@@@@.@..@@@@@@@.@@@.@.@@@..@.@@.@@@@.@.@@@@.@@@...@@@@@@@@@.@@..@@@.@.@.@@..@..@@.@@@@@@..@.@@.@.@@.@.@.@@
@@@@..@...@..@@..@.@@@...@@@@@@@@.@@.@..@.@..@.@@@.@@.@@@@..@@@@@@@..@@.@@@.@@.@.@@@@@@.@@.@@@@.@.@..@@@@@@@@@@.@.@@@@@@.@..@.@.@@@.@.@
@.@@@@@@@@.@@@..@.@.@.@@..@...@....@@@..@@@.@@..@@@..@@@@@@@@.@@....@@@@@@@@..@.@@@..@.@@@.@@@@...@@@..@@@@@.@@@@@.@.@@.@@..@@@@...@.@@
@@.@..@..@@@@...@.@@.@@@..@.@@@...@@..@.@@@@.@..@...@@@@@.@.@@@.@@@@@@.@@@@@@..@@...@..@@@@.@.@.@.@..@@@@.@@.@..@.@@@@@@..@@@@.@.....@.
@.@.@@@@@@@@.@@..@@.@.@@@@@..@@.@@@@@.@.@.@@@..@....@@@@@@@@@@@@.@@@.@@.@.@@@@.@@@@.@...@.@@.@...@@.@.@@@@@@.@.@@@@@@...@.@@.@..@@.@..@
@.@@.@...@@@.@.@@.@@@@@@@@.@@@@@.@@@@.@@.@@@@..@@.@@...@@.@@@@@@.@@.@@.@@@@@.@@.@@.@@@.@@.@.@.@.@@.@.@@.@.@@@@@@.@..@@.@@.@..@@@..@.@@@

View file

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

1173
2025/aoc/inputs/day5.txt Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
3-5
10-14
16-20
12-18
1
5
8
11
17
32

View file

@ -64,6 +64,24 @@ executables:
- -with-rtsopts=-N
dependencies:
- aoc
day4:
main: Main.hs
source-dirs: app/day4
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- aoc
day5:
main: Main.hs
source-dirs: app/day5
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- aoc
tests:
aoc-test: