99 Bottles of beer
24 May 2005


Following on from Sundays code, I then sought to dig out my version of 99 bottles of beer. My 'final' version used 184 bytes. It handles "No", the problematic double \n but NOT the non-plural "1 bottle.”

It took 29 bytes to manage the "No" bit :( :( :( So there must be a better way.

b=99;n[3],*p=" bottles of beer",*q=" on the wall";main(){while(b--)sprintf(n,"%d",b),printf("%d%s%s.\n%d%s,\nTake one down,pass it around.\n%s%s%s.\n\n",b+1,p,q,b+1,p,b?n:"No",p,q);}

Note: everything is on the same line in the actual code.