Moved Intcode interpreter into a separate module, ensured all previous days still...
[advent-of-code-19.git] / advent05 / src / advent05.hs
1
2 import qualified Data.Text.IO as TIO
3
4 import Intcode
5
6
7 main :: IO ()
8 main = do
9 text <- TIO.readFile "data/advent05.txt"
10 let mem = parseMachineMemory text
11 print $ findMachineOutput [1] mem
12 print $ findMachineOutput [5] mem
13
14
15 findMachineOutput inputs program = last output
16 where (_, _, output) = runProgram inputs program