TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Brainfuck interpreter in 160 bytes of C
70 points
by
dahlia
over 14 years ago
6 comments
dmoney
over 14 years ago
Collapse
<p><pre><code> // with whitespace: s[999], *r=s, *d, c; main(a, b) { char *v=1[d=b]; for(;c = *v++ % 93;) for(b = c%7 ? a && (c & 17 ? c & 1 ? (*r -= c - 44) :(r += c - 61) :c & 2 ? putchar(*r) :(*r = getchar()) ,0) :v; b&&c | a * *r; v=d) main(!c,&b-1); d = v; }</code></pre>
评论 #1736060 未加载
coldnose
over 14 years ago
You broke my record 191 bytes!<p><a href="http://coldnose-sloth.livejournal.com/1024.html" rel="nofollow">http://coldnose-sloth.livejournal.com/1024.html</a>
ramki
over 14 years ago
Collapse
That is more than two lines of code obfuscated into two lines... but i like his idea to make this tiny enough to fit in a tweet.
评论 #1732532 未加载
wglb
over 14 years ago
Cool.<p>I have been programming in C for a while, and can't recall ever seeing main called recursively. Neat.
__bjoernd
over 14 years ago
Collapse
I actually prefer readable code, but I accept that others appreciate small size as well.
评论 #1733313 未加载
jhuckestein
over 14 years ago
Who cares about tweets? It fits a text.