Compact C Coding Contest @ 21st Chaos Communication Congress

By | 2013/07/30

I’ve been just wallowing in memories and stumbled over the results of the Compact C Coding Contest of the 21st Chaos Communication Congress, where I participated. Unfortunately I forgot to take care about the exit-code, so I wasn’t able to make it to the top (to be honest – to the top 20) [2].

Based on the problem [3] to develop a code for “uuencode -m”, my submission was:

#include<stdio.h>
int main(int a,char**g){int l,i,n,u=1,x=60;printf(“begin-base64 644 %s”,g[2]);while(u){if(x>59&&puts(“”))x=0;unsigned r=0;l=0;for(a=0;a<3;a++){r<<=8;u=0;if((n=getchar())!=EOF){u=l+=8;r|=(unsigned char)n;}}if(l)for(;a>=0;a–){i=r>>(6*a)&63;putchar(l>0?(i<26?i+65:(i<52?i+71:(i<62?i-4:(i==62?43:47)))):61);l-=6;x++;}}return puts(x?”\n====”:”====”);}

[1] Chaos Communication Congress 21c3

[2] Results Compact C Coding Contest @ 21st Chaos Communication Congress

[3] 21C7 Coding Contest Problem & Rules

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.