Obfuscated code



Following yesterdays (belated) study of the last IOCCC entries (and the subsequent office discussion of our individual obfuscations) I realised there was still one program I hadn't realised publically. The smallest code for the 12 days of christmas song. I shall not reproduce the lyrics here, as that would be silly, but the code is as follows:

main(i){char*q,p[]="thstndrd 12 drummers drumming 11 pipers piping 10 lords a leaping 9 ladies dancing 8 maids a milking 7 swans a swimming 6 geese a laying 5 golden rings 4 calling birds 3 french hens 2 turtle doves and a partridge in a pear tree";for(;q=strrchr(p,9);printf("\nOn the %d%.2s day of christmas my true love sent to me%s\n",i,p+(i<4)*i*2,q),++i)++*q;}

Or, just download the smallest 12 days of christmas source, since the spacing is actually quite important!