View Single Post
Old 05-04-2009, 03:50 AM   #2 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

So what exactly is the challenge? To have your program sing 99 bottles of beer on the wall in the fewest lines of code? If so, try this

PHP Code:
function beer($beerCount =99)
{
do{
echo 
"$beerCount bottles of beer on the wall bla bla";
$beercount--;
} while(
$beerCount 1)
echo 
"One bottle of beer on the wall bla bla";
echo 
"There none left, go sober up and buy some more";
beer(99);

If its sheer lines of code:
PHP Code:
function beer($beerCount =99){do{echo "$beerCount bottles of beer on the wall bla bla";$beercount--;} while($beerCount 1)echo "One bottle of beer on the wall bla bla";echo"There none left, go sober up and buy some more";beer(99);} 
__________________

Village Idiot is offline  
Reply With Quote