do not use list form

This commit is contained in:
Quinten Kock 2021-12-13 07:12:42 +01:00
parent bee1ab2eae
commit 0cfa172289
1 changed files with 4 additions and 5 deletions

View File

@ -29,11 +29,10 @@ main = do
print $ S.size dots1
putStrLn "part 2: "
let dots2 = map (\d -> foldl (flip fold) d folds) dots
let dots2' = S.fromList dots2
let max_x = maximum $ map fst dots2
let max_y = maximum $ map snd dots2
let dots2 = S.fromList $ map (\d -> foldl (flip fold) d folds) dots
let max_x = maximum $ S.map fst dots2
let max_y = maximum $ S.map snd dots2
mapM_ (\y -> do
mapM_ (\x -> putChar (if (x,y) `S.member` dots2' then '#' else '.')) [0..max_x]
mapM_ (\x -> putChar (if (x,y) `S.member` dots2 then '#' else '.')) [0..max_x]
putStrLn ""
) [0..max_y]