X-Git-Url: https://git.njae.me.uk/?p=advent-of-code-19.git;a=blobdiff_plain;f=advent25%2Fsrc%2Fadvent25.hs;h=126fbc8f604f2fd63a40ece46f4fa89a8bb53c2f;hp=c3c0c1f17de6dab420291e2a11000bbee5cb2685;hb=d5c6caeb0b34d4b83284cd6eed0d89f233748861;hpb=3678ceddbeee0dd08141a177709579ee494bc8da diff --git a/advent25/src/advent25.hs b/advent25/src/advent25.hs index c3c0c1f..126fbc8 100644 --- a/advent25/src/advent25.hs +++ b/advent25/src/advent25.hs @@ -31,7 +31,8 @@ runPreamble mem = encodeCommands :: [String] -> [Integer] -encodeCommands cmds = map (fromIntegral . ord) $ concat $ map (++ "\n") cmds +-- encodeCommands cmds = map (fromIntegral . ord) $ concat $ map (++ "\n") cmds +encodeCommands = map (fromIntegral . ord) . concat . map (++ "\n") decodeOutput :: [Integer] -> String decodeOutput = map (chr . fromIntegral) @@ -46,7 +47,6 @@ powerList :: [a] -> [[a]] powerList [] = [[]] powerList (x:xs) = powerList xs ++ map (x:) (powerList xs) - passSecurity :: Machine -> [String] -> [String] -> String passSecurity machine instructions items = "You keep: " ++ (intercalate ", " keeps) ++ "\n\n" ++ (attemptSecurity machine instructions validDropset)