From 4951ed17adeeb43173cbccab78cdcec5e10a2fdc Mon Sep 17 00:00:00 2001 From: Jacob Lagares Pozo Date: Mon, 6 Dec 2021 00:30:25 +0100 Subject: [PATCH] Integrate visualizations into one single executable. --- src/Advent.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Advent.hs b/src/Advent.hs index 97a95c4..3573efe 100644 --- a/src/Advent.hs +++ b/src/Advent.hs @@ -11,6 +11,13 @@ runDay part1 part2 = putStr "Part 1: " >> print part1 >> putStr "Part 2: " >> print part2 +runDayVis :: Integer -> Integer -> IO () -> IO () +runDayVis part1 part2 vis = do + args <- getArgs + if "--visualization" `elem` args + then vis + else runDay part1 part2 + withInput :: (String -> IO ()) -> IO () withInput f = do hSetBuffering stdin NoBuffering -- 2.11.4.GIT