35 lines
1.2 KiB
Haskell
35 lines
1.2 KiB
Haskell
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
import AoC.Day1 as Day1
|
|
import AoC.Day2 as Day2
|
|
import AoC.Day3 as Day3
|
|
import AoC.Day4 as Day4
|
|
|
|
import qualified Data.Text.IO as T (readFile)
|
|
|
|
main :: IO ()
|
|
main = do
|
|
putStrLn "Hello World!"
|
|
input1 <- readFile "./input/day1.txt"
|
|
putStrLn $ show $ Day1.solveA input1
|
|
putStrLn $ show $ Day1.solveB input1
|
|
|
|
input2 <- T.readFile "./input/day2.txt"
|
|
putStrLn $ show $ Day2.solveA "A Y\nB X\nC Z"
|
|
putStrLn $ show $ Day2.solveA input2
|
|
putStrLn $ show $ Day2.solveB "A Y\nB X\nC Z"
|
|
putStrLn $ show $ Day2.solveB input2
|
|
|
|
input3 <- T.readFile "./input/day3.txt"
|
|
let demoInput3 = "vJrwpWtwJgWrhcsFMMfFFhFp\njqHRNqRjqzjGDLGLrsFMfFZSrLrFZsSL\nPmmdzqPrVvPwwTWBwg\nwMqvLMZHhHMvwLHjbvcjnnSBnvTQFn\nttgJtRGJQctTZtZT\nCrZsJsPPZsGzwwsLwLmpwMDw"
|
|
putStrLn $ show $ Day3.solveA demoInput3
|
|
putStrLn $ show $ Day3.solveA input3
|
|
putStrLn $ show $ Day3.solveB demoInput3
|
|
putStrLn $ show $ Day3.solveB input3
|
|
|
|
input4 <- T.readFile "./input/day4.txt"
|
|
let demoInput4 = "2-4,6-8\n2-3,4-5\n5-7,7-9\n2-8,3-7\n6-6,4-6\n2-6,4-8"
|
|
putStrLn $ show $ Day4.solveA demoInput4
|
|
putStrLn $ show $ Day4.solveA input4
|
|
putStrLn $ show $ Day4.solveB demoInput4
|
|
putStrLn $ show $ Day4.solveB input4
|