2022-12-13 16:39:09 +01:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
|
|
|
2022-12-09 21:32:19 +01:00
|
|
|
import AoC.Day1 as Day1
|
2022-12-13 16:39:09 +01:00
|
|
|
import AoC.Day2 as Day2
|
2022-12-14 15:59:06 +01:00
|
|
|
import AoC.Day3 as Day3
|
2022-12-15 17:02:10 +01:00
|
|
|
import AoC.Day4 as Day4
|
2022-12-13 16:39:09 +01:00
|
|
|
|
|
|
|
import qualified Data.Text.IO as T (readFile)
|
2022-12-09 21:32:19 +01:00
|
|
|
|
2022-12-08 11:26:39 +01:00
|
|
|
main :: IO ()
|
2022-12-09 21:32:19 +01:00
|
|
|
main = do
|
|
|
|
putStrLn "Hello World!"
|
2022-12-13 16:39:09 +01:00
|
|
|
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
|
2022-12-14 15:59:06 +01:00
|
|
|
|
|
|
|
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
|
2022-12-15 17:02:10 +01:00
|
|
|
|
|
|
|
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
|