do not use list form
This commit is contained in:
parent
bee1ab2eae
commit
0cfa172289
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in New Issue