TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Brainfuck interpreter in 160 bytes of C

70 pointsby dahliaover 14 years ago

6 comments

dmoneyover 14 years ago
<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 &#38;&#38; (c &#38; 17 ? c &#38; 1 ? (*r -= c - 44) :(r += c - 61) :c &#38; 2 ? putchar(*r) :(*r = getchar()) ,0) :v; b&#38;&#38;c | a * *r; v=d) main(!c,&#38;b-1); d = v; }</code></pre>
评论 #1736060 未加载
coldnoseover 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>
ramkiover 14 years ago
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 未加载
wglbover 14 years ago
Cool.<p>I have been programming in C for a while, and can't recall ever seeing main called recursively. Neat.
__bjoerndover 14 years ago
I actually prefer readable code, but I accept that others appreciate small size as well.
评论 #1733313 未加载
jhuckesteinover 14 years ago
Who cares about tweets? It fits a text.