From: Neil Smith Date: Tue, 5 Dec 2023 20:29:48 +0000 (+0000) Subject: More tidying X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=1599e58ce29dd3ae6a2e0945d5f78c409295703a;p=advent-of-code-23.git More tidying --- diff --git a/advent05/Main.hs b/advent05/Main.hs index 002b8f5..5dab7c1 100644 --- a/advent05/Main.hs +++ b/advent05/Main.hs @@ -54,7 +54,6 @@ useRule (Rule (Iv rl rh) d) (Iv xl xh) = (newResults, newVals, newRules) newVals = filter legalInterval [Iv (max xl (rh + 1)) (max xh rh)] -- input above rule newRules = filter legalRule [Rule (Iv (max (xh + 1) rl) (max xh rh)) d] -- rule above input - useRules :: [Rule] -> [Interval] -> [Interval] useRules [] vals = vals useRules _ [] = [] @@ -64,7 +63,6 @@ useRules (r@(Rule (Iv rl rh) _):rs) (v@(Iv xl xh):vs) | otherwise = newResults ++ (useRules (newRules ++ rs) (newVals ++ vs)) where (newResults, newVals, newRules) = useRule r v - legalInterval :: Interval -> Bool legalInterval (Iv l h) = l <= h diff --git a/advent05/advent-of-code-23.code-workspace b/advent05/advent-of-code-23.code-workspace deleted file mode 100644 index e4e7c68..0000000 --- a/advent05/advent-of-code-23.code-workspace +++ /dev/null @@ -1,7 +0,0 @@ -{ - "folders": [ - { - "path": "../.." - } - ] -} \ No newline at end of file