Skip to content

Instantly share code, notes, and snippets.

@samnardoni
Created July 24, 2010 22:04
Show Gist options
  • Save samnardoni/489019 to your computer and use it in GitHub Desktop.
Save samnardoni/489019 to your computer and use it in GitHub Desktop.
(defn step [stack char]
(if (= char \<)
(pop stack)
(conj stack char)))
(defn run-program [program]
(reduce step [] program))
(run-program (repeat 6e6 "1")) ; Takes ~4 seconds to run on my machine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment