Skip to content

Instantly share code, notes, and snippets.

@tarquin-the-brave
Created May 12, 2020 13:37
Show Gist options
  • Save tarquin-the-brave/7a068f09d142a317d86ed302a28eea9a to your computer and use it in GitHub Desktop.
Save tarquin-the-brave/7a068f09d142a317d86ed302a28eea9a to your computer and use it in GitHub Desktop.
runInstruction :: Intcode -> Prog Intcode
runInstruction ic = do
opcodes <- currentOpCode ic
case opcodes of
(One, m1, m2, m3) -> do
newIc <- op1 m1 m2 m3 (ip ic) (code ic)
return $ moveIp 4 . updateCode newIc $ ic
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment