#include<stdio.h>
#define _ for(j=4;i%3&&j>0;x=(p.d&63<<6*j)>>6*j,putchar(
#define O x<26?65+x:x<52?71+x:x<62?x-4:x*4-205))--j;p.d=0;}
int main(int c,char** v){union{char c[3];int d:24;}p;int i=-1,j,x;while(p.c[2-i%3]=v[1][++i]){if(i%3>1){_ O}_ j<3-i%3?61:O
I can't get it any shorter now
Name:
Anonymous2012-03-13 20:56
>>5
Putting it all on one line and in macros =/= making it shorter
Name:
Anonymous2012-03-13 21:05
int main(int c,char** v){
union{
char c[3];
int d:24;
}p;
int i=-1,j,x;
while(p.c[2-i%3]=v[1][++i]){
if(i%3>1){
for(j=4;i%3&&j>0;x=(p.d&63<<6*j)>>6*j,putchar( x<26?65+x:x<52?71+x:x<62?x-4:x*4-205))
--j;
p.d=0;
}
}
for(j=4;i%3&&j>0;x=(p.d&63<<6*j)>>6*j,putchar( j<3-i%3?61:x<26?65+x:x<52?71+x:x<62?x-4:x*4-205))
--j;
p.d=0;
}
pig disgusting
Name:
omgoptimized2012-03-13 21:05
It really only depends on what you set as a goal.
This time I was trying to make the source file the smallest I could (260 bytes, with windows' CR/LF). I had fun doing this, but I might try making stuff shorter with the different approach you mentioned.
Care to share the "rules"? No #defines, what counts as shorter, etc.
Name:
Anonymous2012-03-13 21:40
#include <stdlib.h>
int main(void) {
return system("base64 -d -");
}
Initially I was trying to make the original code as obfuscated as possible. Then I switched my goal to making it the shortest code possible. I guess this obfuscates it well too :)
Name:
Anonymous2012-03-14 8:34
You failed to accomplish any of those goals
Name:
Anonymous2012-03-14 10:48
>>17
I don't see how it isn't the shortest - nobody proved me wrong yet.