handleCommand ":poke8" state =
do let machines = state ^. ssMachines
let machine = head machines
- let machine' = machine & registers . ix 7 .~ 1
+ let machine' = machine & registers . ix 7 .~ 25734
+ & memory . ix 5489 .~ 21
+ & memory . ix 5490 .~ 21
+ & memory . ix 5495 .~ 7
+ -- let machine' = machine & memory . ix 5451 .~ 7
return $ state & ssMachines .~ (machine' : (tail machines))
handleCommand command state = return $ runOneInput state command
(exState, machine', output) = runMachine [] (machine & inputIndex .~ 0)
runOneInput :: SynacorState -> String -> SynacorState
+runOneInput state ":poke8" = state & ssMachines .~ ssMAchinesNew
+ where machine0 = head $ state ^. ssMachines
+ machine = machine0 & registers . ix 7 .~ 25734
+ & memory . ix 5489 .~ 21
+ & memory . ix 5490 .~ 21
+ & memory . ix 5495 .~ 7
+ ssMAchinesNew = machine : (tail $ state ^. ssMachines)
+
runOneInput state input = state & ssMachines %~ (machine' :)
& ssInputs %~ (input :)
& ssOutputs %~ ((showOutput output) :)