Created
July 24, 2010 22:04
-
-
Save samnardoni/489019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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