Skip to content

Instantly share code, notes, and snippets.

@devn
Forked from alandipert/wozniak.clj
Created March 10, 2013 09:01
Show Gist options
  • Save devn/5127703 to your computer and use it in GitHub Desktop.
Save devn/5127703 to your computer and use it in GitHub Desktop.
(eval((fn[program](let [n (zipmap '(+ - > < . ?)(repeatedly gensym))](letfn[(f*[
s] (if (vector? s) `(while (not (~(n '?))) ~@(map f* s)) `(~(n s))))]`(let [t# (
int-array 100 0)pt# (atom 0)a#(fn[c#]#(aset t# @pt#(c# (aget t# @pt#))))b#(fn[d#
]#(swap! pt# d#)) ~(vec (map n '(+ - > <)))(map #(%1 %2)[a# a# b# b#](cycle [inc
dec]))~(n '.)#(print(char(aget t# @pt#)))~(n '?)#(zero?(aget t# @pt#))]~@(map f*
(read-string(str "("(->> program (interpose \space) (apply str)) ")" )))))))"+++
+++++[>++++++++<-]>+.[>+<-]+++++[>-----<-]>--------.[>+<-]++++++++[>++++++++<-]>
++++++++++++.+++.+++++.[>+<-]+++++++++[>---------<-]>---.[>+<-]++++++++[>+++++++
+<-]>+++++++++++++++.---------.[>+<-]++++++++[>--------<-]>------.[>+<-]++++++++
[>++++++++<-]>++++++++.-------.++.++++++++.--.+++++.-------.[>+<-]++++++++[>----
----<-]>-------.[>+<-]++++++++[>++++++++<-]>+++++++++.++++++++++.[>+<-]+++++++++
[>---------<-]>--.[>+<-]++++++++[>++++++++<-]>++++++++++++++++.----.-----------.
++++++++++++++++++++++++.----------------.+++++.-------.[>+<-]++++++++[>--------
<-]>-------.[>+<-]+++++++++[>+++++++++<-]>++++++.--------------.+++++++++++.----
--------.[>+<-]++++++++[>--------<-]>--------.[>+<-]++++++++[>++++++++<-]>++++++
+++++++++.+++++.------------.---.+++++++++++++.[>+<-]+++++++++[>---------<-]>-.[
>+<-]++++++++[>++++++++<-]>++++++++++++++++.-----------.++++++++++.+.----.------
-.[>+<-]+++++++[>-------<-]>--------.------------.[>+<-]+++++++++[>+++++++++<-]>
++++++++.----------.++++++.[>+<-]+++++++++[>---------<-]>----.[>+<-]++++++++[>++
++++++<-]>+++++++++++.+++.+.++++++++.[>+<-]++++++++[>--------<-]>-----------.---
---------.[>+<-]++++++++[>++++++++<-]>+++++++.--.+++++++++++++++..-----------.++
+++.-------.[>+<-]++++++++[>--------<-]>-------.[>+<-]+++++++++[>+++++++++<-]>++
+.------------.---.++++++++.[>+<-]++++++++[>--------<-]>-------------.[>+<-]++++
+++++[>+++++++++<-]>+++.-----.[>+<-]++++++++[>--------<-]>---------------.[>+<-]
++++++++[>++++++++<-]>++++.+++++++++++.[>+<-]++++++++[>--------<-]>-------------
--.[>+<-]+++++++++[>+++++++++<-]>++.+.--.-----------------.+++++++++++++.-------
.--.[>+<-]++++++++[>--------<-]>-----.[>+<-]+++++++++[>+++++++++<-]>+++.--------
----.+.+++++.-------.++++++++++++.[>+<-]++++++++[>--------<-]>-----.------------
--.+++++++++++++.[>+<-]++++++[>++++++<-]>++.[>+<-]+++++[>+++++<-]>++++++++.-----
----------.+++++++++++++++++.-----------------.[>+<-]++++++++[>--------<-]>-----
.[>+<-]+++++++[>+++++++<-]>++++++.++++++++++++++++++++++++.+++++++++++.---------
---.-----.--------.++++++++++.[>+<-]+++++++++[>---------<-]>----------------."))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment