From 9d1c6f30c5ca71a6243169b88cb39351686e0602 Mon Sep 17 00:00:00 2001 From: Steph Date: Sat, 3 Dec 2022 10:02:56 +0100 Subject: [PATCH] Day 3 done! --- 2022/aoc2022.cabal | 4 +- 2022/app/Day3/Main.hs | 61 +++++++++ 2022/app/Day3/input | 300 ++++++++++++++++++++++++++++++++++++++++++ 2022/app/Main.hs | 2 + 2022/default.nix | 1 + 5 files changed, 366 insertions(+), 2 deletions(-) create mode 100644 2022/app/Day3/Main.hs create mode 100644 2022/app/Day3/input diff --git a/2022/aoc2022.cabal b/2022/aoc2022.cabal index 37bfbe8..f1ce2f7 100644 --- a/2022/aoc2022.cabal +++ b/2022/aoc2022.cabal @@ -29,7 +29,7 @@ executable aoc2022 -- LANGUAGE extensions used by modules in this package. -- other-extensions: - build-depends: base ^>=4.16.3.0 + build-depends: base ^>=4.16.3.0, split ^>=0.2.3.5 hs-source-dirs: app default-language: Haskell2010 - other-modules: Day1.Main Day2.Main + other-modules: Day1.Main Day2.Main Day3.Main diff --git a/2022/app/Day3/Main.hs b/2022/app/Day3/Main.hs new file mode 100644 index 0000000..3db019d --- /dev/null +++ b/2022/app/Day3/Main.hs @@ -0,0 +1,61 @@ +module Day3.Main (main) where + +import System.IO +import Data.Char +import Data.List.Split + +main :: IO () +main = do + putStrLn "Day 3" + + handle <- openFile "app/Day3/input" ReadMode + contents <- hGetContents handle + + let r1 = part1 contents + putStrLn $ "part 1: " ++ show r1 + + let r2 = part2 contents + putStrLn $ "part 2: " ++ show r2 + +type Rucksack = (String, String) + +parseData :: String -> [Rucksack] +parseData input = compartments + where + rucksacks = lines input + compartmentSize = map ((`div` 2) . length) rucksacks + firstCompartments = map (\(s, r) -> take s r) (zip compartmentSize rucksacks) + secondCompartments = map (\(s, r) -> drop s r) (zip compartmentSize rucksacks) + compartments = zip firstCompartments secondCompartments + +inBoth :: Eq a => [a] -> [a] -> [a] +inBoth a b = [x | x <- a, y <- b, x == y] + +allEqual :: Eq a => [a] -> Bool +allEqual [] = True +allEqual (x:xs) = all (== x) xs + +inAll :: Eq a => [[a]] -> [a] +inAll xs = map ((!! 0) . snd) res + where + prod = sequence xs + equal = map allEqual prod + res = filter fst (zip equal prod) + +getValue :: Char -> Int +getValue a | a >= 'a' && a <= 'z' = ord a - ord 'a' + 1 +getValue a | a >= 'A' && a <= 'Z' = ord a - ord 'A' + 1 + 26 + +part1 :: String -> Int +part1 contents = sum values + where + both = map (uncurry inBoth) (parseData contents) + single = map (!! 0) both + values = map getValue single + +part2 :: String -> Int +part2 contents = sum values + where + groups = chunksOf 3 (lines contents) + badges = map ((!! 0) . inAll) groups + values = map getValue badges diff --git a/2022/app/Day3/input b/2022/app/Day3/input new file mode 100644 index 0000000..e12b761 --- /dev/null +++ b/2022/app/Day3/input @@ -0,0 +1,300 @@ +NJvhJcQWTJWTNTFFMTqqGqfTmB +VwVzPldRZVLVRmfsvfjvqfmm +ZDPDHZHVcvDhbvnv +FHHwHBzzVCWWmmCzCPrVmgBwbLTtRFFbbbttRGRLjTcLpbbT +vhZZvdsNSdSMdNvjncppCLcLnGnj +CDZZsNZMZqdNSdlNZCqrzPHDzgrgzwVVWwmwwm +ndlndntsFJntFvccLjjLrjBShcBBfc +GpCGHzVwmmzqQWSSSfWHBhQL +mpCMGGCZVzVwGGVwmJsZnFtZnTSTJtdsvl +nCnPDGmDNmVCsVQDmGSWqvzchWSjjcWGqS +gTnBRLpfTRnrTdZgdLfRdrThvqcvWWhFFWvcFSSgjqqzjv +pfZfTMwrbLTTfsbmQtlVtHHnbs +wNdSdsbTvTZMTvTv +rrdRWdWQhFVdHWBGWQmmmnnMvCfmnhvmCmtZ +rJrVDRWpGddpbSlNSlspPP +chTNrthMMwWMTjfsmRzZszJpwm +BLnFFCngbcBnbbldDlpRjGpmsCzGsGsRGmmG +dqvnvlgbqtcPPMhH +QcLNqZbCzJDQBJJRpwzRpdnRldgnpf +GmmmvVGsHrWffrlwdCWd +CMsFVVFjCmFStGQbbLZNBbJBcTjc +LQV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SNZRR +ppszzDfhDfhsqpnvDVTfGpSPlPmclHcdRcZmmmdPPGSP +pvtDDVDVpqDfzDfngBLCwQrgCtCwFwrg +pbGjFFGGDjpbsGsmNhNFNRBBBtRhhhHv +JnczJVCvwWJvhPgghgNtNtNJ +nwVSSzdzzqSpvQSZQG +mssLLttQrsMrMzLCRmMmrrSQpvWpDNlBTBDlvNTccDQl +HdHJwJqVPwHnqJwbjJbGjnSgSTWPpNgWWpgBBgcvDWWN +ZHVwVZGwwdndqJVJqfHbGwnwrRLtLMftMvMMRrhmLMthhLmz +RgHGLbTqlZlPRZPHfvvfZttJnvfvjnzr +sVcChDVDccwNhhvjTvVzWJjnzFff +mpNcCMTCGmLqBLGH +wVJwHJHVMtMpBmDDWPQVPWDGDD +zCrlZzCblBvnCDWNGLmvGDLPNG +dqZglgbzrzbbgZqzTFSBHHFJSSSfjjSMfwhj +NMWJSjLMCnHHNMNNHWCHMbVVGBPZTrPVPBVDrBSDGTTr +zvttlFpgdtldwwvftPDPTWQdBZrsrWrGBZ +hFlFmhRFvfCbmWJWHcnj diff --git a/2022/app/Main.hs b/2022/app/Main.hs index 6a42df3..97d529a 100644 --- a/2022/app/Main.hs +++ b/2022/app/Main.hs @@ -2,8 +2,10 @@ module Main where import qualified Day1.Main as Day1 import qualified Day2.Main as Day2 +import qualified Day3.Main as Day3 main :: IO () main = do Day1.main Day2.main + Day3.main diff --git a/2022/default.nix b/2022/default.nix index 6802d9a..631233a 100644 --- a/2022/default.nix +++ b/2022/default.nix @@ -7,6 +7,7 @@ pkgs.stdenv.mkDerivation rec { name = "aoc-2022"; buildInputs = [ pkgs.haskell.compiler.${hc} + pkgs.haskellPackages.split pkgs.git pkgs.zlib pkgs.cabal-install