tweaks to playground files

This commit is contained in:
2024-11-25 16:25:05 -08:00
parent acb37a2882
commit 6f954b1183
4 changed files with 36 additions and 67 deletions

View File

@@ -51,20 +51,21 @@ part1 text digits =
#check digits1 unpack : String -> List Int
runFile : String -> IO Unit
runFile fn = do
text <- readFile fn
putStrLn fn
putStrLn "part1"
putStrLn $ show (part1 text (digits1 unpack))
putStrLn "part2"
putStrLn $ show (part1 text (digits2 unpack))
putStrLn ""
-- readFile not in browser / playground
-- runFile : String -> IO Unit
-- runFile fn = do
-- text <- readFile fn
-- putStrLn fn
-- putStrLn "part1"
-- putStrLn $ show (part1 text (digits1 ∘ unpack))
-- putStrLn "part2"
-- putStrLn $ show (part1 text (digits2 ∘ unpack))
-- putStrLn ""
-- Argument is a hack to keep it from running at startup. Need to add IO
main : IO Unit
main = do
runFile "aoc2023/day1/eg.txt"
runFile "aoc2023/day1/eg2.txt"
runFile "aoc2023/day1/input.txt"
-- -- Argument is a hack to keep it from running at startup. Need to add IO
-- main : IO Unit
-- main = do
-- runFile "aoc2023/day1/eg.txt"
-- runFile "aoc2023/day1/eg2.txt"
-- runFile "aoc2023/day1/input.txt"