diff --git a/day11/Commons.hs b/day11/Commons.hs index 26fcd99..3f05be4 100644 --- a/day11/Commons.hs +++ b/day11/Commons.hs @@ -34,7 +34,7 @@ getExpansionArray i expOffset expInc (h: t) getExpansionArrays :: Int -> Image -> (ExpansionArray, ExpansionArray) getExpansionArrays expInc image = let expX = getExpansionArray 1 0 expInc $ sortUniq . map fst $ image expY = getExpansionArray 1 0 expInc $ sortUniq . map snd $ image - in (listArray (1, length expX) expX, listArray (1, length expY) expY) + in (listArray (1, length expX) expX, listArray (1, length expY) expY) getDistancesGalaxy :: Image -> (ExpansionArray, ExpansionArray) -> (Int, Int) -> [Int] getDistancesGalaxy [] _ _ = [] diff --git a/day13/Commons.hs b/day13/Commons.hs index a07af56..7136b00 100644 --- a/day13/Commons.hs +++ b/day13/Commons.hs @@ -44,7 +44,7 @@ isLineReflected (y1, x1) (y2, x2) p isVerticalReflection :: (Int, Int) -> Pattern -> Bool isVerticalReflection (y, x) p | y <= fst (snd $ bounds p) = isLineReflected (y, x) (y, x + 1) p && isVerticalReflection (y + 1, x) p - | otherwise = True + | otherwise = True isColReflected :: (Int, Int) -> (Int, Int) -> Pattern -> Bool isColReflected (y1, x1) (y2, x2) p @@ -54,7 +54,7 @@ isColReflected (y1, x1) (y2, x2) p isHorizontalReflection :: (Int, Int) -> Pattern -> Bool isHorizontalReflection (y, x) p | x <= snd (snd $ bounds p) = isColReflected (y, x) (y + 1, x) p && isHorizontalReflection (y, x + 1) p - | otherwise = True + | otherwise = True getVerticalReflection :: Int -> Int -> Pattern -> Int getVerticalReflection x ignore p | x >= snd (snd $ bounds p) = 0