From: Neil Smith Date: Mon, 7 Dec 2020 14:22:17 +0000 (+0000) Subject: Some tidying X-Git-Url: https://git.njae.me.uk/?p=advent-of-code-19.git;a=commitdiff_plain;h=d5c6caeb0b34d4b83284cd6eed0d89f233748861 Some tidying --- 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)