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.

ASCII animated donut in obfuscated C

81 pointsby yogsotothalmost 14 years ago

10 comments

rhdoengesalmost 14 years ago
His entire blog is a pure obfuscated goldmine. Just look at his footer:<p><pre><code> _=0;k;main(){while(_&#60;641){for(k=0;"##K#8(38D-##C]L5870.X7\\M_b;90\\" "MC-M/NZGB6Q,I0VGB6a0FbN&#60;VG.6Q\\bNb7^@`X=N@`XQaOVX:^]NX=:Z8PY]B`:&#62;P" "NY8^$#SM):XA"[_/6]-35&#62;&#62;_++%6&#38;1;k++);putchar(k[" _/\\\n,`)('&#60;-"]);}}</code></pre>
评论 #2746453 未加载
a1k0nalmost 14 years ago
Haha. I don't get why this particular one attracts so much attention, as it was my first one and is pretty amateurish compared to this one:<p><a href="http://a1k0n.net/2006/09/20/obfuscated-c-donut-2.html" rel="nofollow">http://a1k0n.net/2006/09/20/obfuscated-c-donut-2.html</a>
评论 #2746493 未加载
评论 #2747231 未加载
donutalmost 14 years ago
Here's a more readable version:<p><a href="https://gist.github.com/1073922" rel="nofollow">https://gist.github.com/1073922</a>
评论 #2746483 未加载
评论 #2746295 未加载
JonnieCachealmost 14 years ago
If this is the kind of thing you're into, check out the The International Obfuscated C Code Contest at <a href="http://www.ioccc.org" rel="nofollow">http://www.ioccc.org</a><p>Some of the submissions are absolutely fiendish. Fabrice Bellard's are particularly interesting, just like all his other work.<p>See if you can work out what westley.c from 1988 does:<p><pre><code> #define _ -F&#60;00||--F-OO--; int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO() { _-_-_-_ _-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_-_-_-_-_ _-_-_-_-_-_-_-_ _-_-_-_ }</code></pre>
评论 #2747024 未加载
zkarcheralmost 14 years ago
I can't compile this. What am I doing wrong? Here is the output:<p>$ gcc -o donut donut.c -lm<p>donut.c:1: warning: data definition has no type or storage class<p>donut.c: In function ‘main’:<p>donut.c:4: warning: incompatible implicit declaration of built-in function ‘printf’<p>donut.c:5: warning: incompatible implicit declaration of built-in function ‘memset’
评论 #2746647 未加载
评论 #2746576 未加载
KonradKlausealmost 14 years ago
I'm totally impressed that<p>b[o] = ".,-~:;=!*#$@"[N &#62; 0 ? N : 0];<p>is allowed in C.
评论 #2746468 未加载
评论 #2747484 未加载
jgeralnikalmost 14 years ago
Wow. Just wow. Compile this. Run this. Just wow.
edge17almost 14 years ago
that was cool for a saturday afternoon. extra points for creative packaging.
memsetalmost 14 years ago
Very cool - I've never played with sending special terminal characters before to clear the screen and the like; like others, I will definitely add this to my repertoire!<p>My suggestion for deciphering it - let's not forget about `indent`!<p>Both iterations of the donut.c program: <a href="https://gist.github.com/1074316" rel="nofollow">https://gist.github.com/1074316</a>
john2xalmost 14 years ago
How does one go about making stuff like this?
评论 #2746676 未加载
评论 #2747047 未加载