Twelve Days of Christmas by idealmachine

for(a=12;a--;)print('On the','twelfth0eleventh0tenth0ninth0eighth0seventh0sixth0fifth0fourth0third0second0first'.split(0)[a],'day of Christmas,\nmy true love sent to me\n'+(11-a?'Twelve drummers drumming0Eleven pipers piping0Ten lords a-leaping0Nine ladies dancing0Eight maids a-milking0Seven swans a-swimming0Six geese a-laying0Five golden rings0Four calling birds0Three French hens0Two turtle doves'.split(0).slice(a).join(',\n')+',\nAnd a':'A'),'partridge in a pear tree'+(a?'.\n':'!\n'))

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page