From: Neil Smith Date: Mon, 26 Dec 2016 12:21:00 +0000 (+0000) Subject: Tidying X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=474b47bdae540d9e3e3a31a6fd9fbaf450dcc395;p=advent-of-code-16.git Tidying --- diff --git a/adventofcode1625/app/advent25.hs b/adventofcode1625/app/advent25.hs index 077201f..f19c046 100644 --- a/adventofcode1625/app/advent25.hs +++ b/adventofcode1625/app/advent25.hs @@ -67,11 +67,6 @@ part1 instrs = inputs = [0..] validInputs = filter (validMachine) inputs validMachine i = valid $ evalMachine m0 i - -- let config = AppConfig {cfgMaxRun = 500000} - -- m0 = emptyMachine {instructions=instrs} - -- -- res = runState (runReaderT (runMachine "") config) st - -- res = evalState (runReaderT (runMachine "") config) m0 - -- in print res -- (signal, st') valid :: String -> Bool @@ -82,7 +77,7 @@ evalMachine machine0 input = evalState (runReaderT (runMachine "") config) m where m = machine0 {a = input} config = AppConfig {cfgMaxRun = 500000} -runMachine :: String -> App -- State Machine String +runMachine :: String -> App runMachine output = do cfg <- ask m <- get @@ -92,7 +87,7 @@ runMachine output = runMachine (output ++ thisOutput) -executeStep :: App -- State Machine String +executeStep :: App executeStep = do m <- get let i = (instructions m)!!(pc m)