-- Writeup at https://work.njae.me.uk/2022/12/04/advent-of-code-2022-day-4/
-import System.Environment
+import AoC
import Data.Text (Text)
import qualified Data.Text.IO as TIO
import Data.Attoparsec.Text hiding (take)
putStrLn $ part1 wharf moves
putStrLn $ part2 wharf moves
-
-getDataFileName :: IO String
-getDataFileName =
- do args <- getArgs
- progName <- getProgName
- let baseDataName = if null args
- then progName
- else head args
- let dataFileName = "data/" ++ baseDataName ++ ".txt"
- return dataFileName
-
-
part1 :: Wharf -> [Move] -> String
part1 wharf moves = showTops $ applyMoves1 wharf moves