From 31cf6b68d3b34fcf1fc3f57fb365c61503c6dc7c Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Fri, 20 Dec 2024 14:40:51 +0000 Subject: [PATCH] Tidying --- advent20/Main.hs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/advent20/Main.hs b/advent20/Main.hs index 48ac9e8..1b3a4ab 100644 --- a/advent20/Main.hs +++ b/advent20/Main.hs @@ -47,13 +47,6 @@ main = part1, part2 :: Track -> TrackCost -> TrackCost -> Int part1 = bigSavings 2 100 part2 = bigSavings 20 100 --- where fullCost = costsFromStart M.! track.goal --- cheatCosts = allCheatedCosts 2 track costsFromStart costsFromGoal --- savings = filter (>= 100) $ fmap (\c -> fullCost - c) cheatCosts --- part2 track costsFromStart costsFromGoal = length savings --- where fullCost = costsFromStart M.! track.goal --- cheatCosts = allCheatedCosts 20 track costsFromStart costsFromGoal --- savings = filter (>= 100) $ fmap (\c -> fullCost - c) cheatCosts bigSavings :: Int -> Int -> Track -> TrackCost -> TrackCost -> Int bigSavings cheatLen savingThreshold track costsFromStart costsFromGoal = length savings @@ -71,7 +64,6 @@ mkTrack text = Track { walls = walls, start = start, goal = goal } start = head [ V2 r c | r <- [0..rMax], c <- [0..cMax], rows !! r !! c == 'S' ] goal = head [ V2 r c | r <- [0..rMax], c <- [0..cMax], rows !! r !! c == 'E' ] - showTrackWithCheat :: Track -> Position -> String showTrackWithCheat track here = unlines $ fmap showRow [0..rMax] where rMax = maximum $ fmap (\(V2 r _) -> r) $ S.toList $ walls track -- 2.34.1