Skip to content

Instantly share code, notes, and snippets.

@Scriptor
Created March 25, 2013 20:07
Show Gist options
  • Save Scriptor/5240224 to your computer and use it in GitHub Desktop.
Save Scriptor/5240224 to your computer and use it in GitHub Desktop.
(fn stepper (state _)
(let [pc (:state :pc)
instrs (:state :instructions)
instr (:instrs pc)]
(cond
((=== (:instr 0) :jmp) {:pc (:instr 1), :instructions instrs}))))
(reduce #stepper [[:jmp 1] [:jmp 0]] (infinity))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment