3 ms·
That reminded me a lot of my old signature from my days on Slashdot: main(O){10<putchar(4^--?77-(15&5128>>4*O):10)&&main(2+O);} I enjoyed the extra mini-c
by unwind 14y ago
That reminded me a lot of my old signature from my days on Slashdot:
main(O){10<putchar(4^--?77-(15&5128>>4*O):10)&&main(2+O);}
I enjoyed the extra mini-confusement from using a capital O as a variable name. :)
- bru 14y agoHello Emil, I believe there is a mistake in this snippet of code: `--` triggers a syntax error. Shouldn't it be main(O){10<putchar(4^--O?77-(15&5128>>4*O):10)&&main(2+O);} My obfuscated C experience being quite limited, could you tell me how you determined all those magic values in order to print the right string? Thank you
- unwind 14y agoWhoa, thanks! This must be some kind of copy-paste error. One problem with obfuscated code is obviously that it's way harder to spot those than in regular code. :) I had to double-check that it's right in my profile on Stack overflow (which is where I copied it from for the above comment), but it is. That's even stranger.
- joshguthrie 14y agoI can't even compile it on my mac and my C is too rusty, would you be kind enough to explain? =)
- unwind 14y agoIt's perfectly possible to run this on e.g. Ideone (http://ideone.com http://ideone.com). Essentially, it's a loop that unpacks my name and prints it, letter by letter, from the constant 5128. Four bits is being used per letter, and I tried to compress the number by subtracting an offset from the ASCII codes of each letter (that's the 77). It's been ~14 years or something since I first wrote this, and I'm pretty sure I was inspired by an Obfuscated C contest entry then, too. :)
- stordoff 14y agoThere's a typo in it, which is probably why it doesn't compile (other replies have the correct version). This is the output: > stordoff@stordoffs-MacBook-Pro:~ $ gcc HN.c && ./a.out > EMIL
- irfan 14y agoInteresting, tried making my version main(O){10<putchar(5^--O?82-(31&4763657>>5*O):10)&&main(2+O);}