From: Neil Smith Date: Fri, 9 Dec 2016 15:54:59 +0000 (+0000) Subject: Tweaking X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=be703250238d6be7f7b9bcb4adaf5c72c23a3bf2;p=advent-of-code-16.git Tweaking --- diff --git a/advent08.hs b/advent08.hs index e314b67..c89ba80 100644 --- a/advent08.hs +++ b/advent08.hs @@ -29,6 +29,7 @@ showScreen screen = unlines [showRow r | r <- [minRow..maxRow]] countLights :: Screen -> Int countLights screen = length $ filter (id) $ elems screen +screen0 :: Screen screen0 = mkScreen 50 6 @@ -36,7 +37,6 @@ main :: IO () main = do text <- readFile "advent08.txt" let instrs = successfulParse $ parseCommands text - -- print instrs part1 instrs part2 instrs @@ -84,6 +84,8 @@ execute (Rotate Row r n) screen = (rotateRow screen r n, 0) extractScreen :: ScState Int -> Screen extractScreen (ScState st) = fst (st screen0) + + parseCommands :: String -> Either ParseError [Command] parseCommands input = parse commandFile "(unknown)" input