Fix some output

This commit is contained in:
daniele 2024-12-18 16:41:45 +01:00
parent f9513efab4
commit d9ffa3b0cf
Signed by: fuxino
GPG Key ID: 981A2B2A3BBF5514
2 changed files with 2 additions and 1 deletions

View File

@ -205,4 +205,4 @@ day15_1 = do
directions = map (fromJust . getDirection) $ concat d
startPos = getStartPosition '@' grid
finalGrid = visitGrid startPos directions grid
print . sum $ boxCoords finalGrid
putStrLn $ "Day 15, Puzzle 1 solution: " ++ show (sum $ boxCoords finalGrid)

View File

@ -122,4 +122,5 @@ day17_1 = do
registers = map (read . filter isDigit) r
prog = map (read . filter isDigit) $ splitOn "," p
computer = Computer {registerA = fst . fromJust $ uncons registers, registerB = registers !! 1, registerC = registers !! 2, pointer = 0, program = prog, output = ""}
putStr "Day 17, Puzzle 1 solution: "
print . drop 1 . output $ execState runProgram computer