From 6ef036e2c5a70eda2205a8f4828575909752b008 Mon Sep 17 00:00:00 2001 From: shu Date: Tue, 3 Dec 2019 16:10:48 +0100 Subject: [PATCH] day 3: small tweak --- 2019/day3/day3.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2019/day3/day3.hs b/2019/day3/day3.hs index 5580a5f..f8a386c 100644 --- a/2019/day3/day3.hs +++ b/2019/day3/day3.hs @@ -14,7 +14,7 @@ parse :: String -> [[(Char,Int)]] parse = map (map (\x->(head x,read $ tail x))) . map (splitOn ",") . lines gensteps :: [(Char,Int)] -> [V2 Int] -gensteps = scanl (+) (V2 0 0) . concatMap (\(x,y)->replicate y $ step x) +gensteps = scanl1 (+) . concatMap (\(x,y)->replicate y $ step x) step :: Char -> V2 Int step x