From: Neil Smith Date: Mon, 12 Dec 2016 12:44:04 +0000 (+0000) Subject: More tidying X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=5fd57ba9da53a1ee824ea4153090b40f9dd15ebd;p=advent-of-code-16.git More tidying --- diff --git a/advent11.hs b/advent11.hs index af048de..58215fd 100644 --- a/advent11.hs +++ b/advent11.hs @@ -110,10 +110,8 @@ legalSuccessors :: [Building] -> [Building] legalSuccessors = filter (isLegal) updateBuilding :: Int -> [Floor] -> Int -> [Item] -> Building --- updateBuilding f floors _ _ = Building f floors updateBuilding oldF oldFloors newF items = Building newF newFloors - where numberedFloors = zip [0..] oldFloors - newFloors = map (updateFloor) numberedFloors + where newFloors = map (updateFloor) $ zip [0..] oldFloors updateFloor (f, fl) | f == oldF = sort $ fl \\ items | f == newF = sort $ items ++ fl