Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C Challenge

Name: omgoptimized 2012-03-13 18:58

So I wrote a C program that encodes its first command line argument using base64 and prints it to the standard output.

Can anybody make this program shorter? I bet someone can.
And yes this is probably not ANSI C, I don't even care.


#include<stdio.h>
#define _ for(j=3;(i%3)&&j>-1;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

Name: Anonymous 2012-03-13 22:51

Protip: gcc spits out the same ASM for all your less-used syntax and lack of whitespace as normal syntax.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List