X-Git-Url: https://git.njae.me.uk/?p=advent-of-code-22.git;a=blobdiff_plain;f=advent25%2FMain.hs;fp=advent25%2FMain.hs;h=28c33f751f4afc874e952d4b29371472782536f9;hp=4e6cf876029e4dd73645a67d553b3688a8fadf58;hb=402a27d38485107852e8128f20a443cc7a684c6d;hpb=d26baeb75e7bb105eb23c7434832203dc2ce6cfa diff --git a/advent25/Main.hs b/advent25/Main.hs index 4e6cf87..28c33f7 100644 --- a/advent25/Main.hs +++ b/advent25/Main.hs @@ -10,7 +10,6 @@ main = numStrs <- readFile dataFileName let fuels = fmap readSnafu $ lines numStrs putStrLn $ showSnafu $ sum fuels - -- print $ part1 fuels readSnafu :: String -> Int readSnafu cs = foldl' go 0 cs @@ -36,7 +35,7 @@ packSnafu :: [Int] -> String packSnafu digits | carry == 0 = shown | otherwise = (snafuRep carry) : shown - where (carry, shown) = foldl' packSnafuDigit (0, "") digits + where (carry, shown) = foldl' packSnafuDigit (0, "") packSnafuDigit :: (Int, String) -> Int -> (Int, String) packSnafuDigit (carry, acc) d