r/shittyprogramming • u/Cyragia • May 14 '15
I had a go at FizzBuzz...
... and I regret nothing.
#include <stdio.h>
int(*z)(int)=putchar;int main(int _,char
** ___){int _0=0xDEAD,__=0xBABE;for(;!(_
^1) && _0;_0=0){while(__=0,(_%3==0)?main
(2,0),__=1:77,(_%5==0)?main(3,0),__=1337
:_<<27&42,(!__)?main(15258<<16|0xCA<<8,(
char**)((long)_)):05,z(10),_++,_<=100){}
main(0,0);}for(;(_&(1<<1))?_=4*(_-2),z(z
(17-3*_+z(z(70-_)+35+4*_))),__=23:0xC0DE
,_0;_0=0){for( ;__;__=0){long _0_=(long)
___|0;for(;_>=1;_0_/_?z(48+_0_/_):77,_0_
=_0_%_,_/=012){}}}}//??????????????????/
================FizzBuzz================It compiles without errors/warnings on gcc and is fully c99 compatible.
159
Upvotes
84
u/lrflew May 14 '15 edited May 15 '15
I'm spending way too much time trying to decipher how this works. So far, I've removed the comma notation (never knew you could use it like that) and renamed the variables to something more readable. Next up is to simplify the logic. This is what I have so far:
EDIT: Cleaned up the logic some. I tried to keep the core logic the same, but also reduce complexity. I ended up removing a variable and adding another one. This is for the most part functionally the same, but not identical.
7
u/skiguy0123 May 15 '15
You should multithread for spead
+/u/CompileBot Python 3
15
u/[deleted] May 15 '15
Now write it in assembly
11
u/Glaiel-Gamer May 15 '15 edited May 15 '15
pfffftttpphbbtthb
+/u/CompileBot c++
I should obfuscate / decorate this one up to make it even less decipherable
16
u/Niles-Rogoff May 14 '15
"No warnings"
1
u/gratefuldaed May 18 '15
Been a while since abstract algebra?
1
u/computerorfridge Aug 02 '15