05-04-2009, 03:52 AM
|
#4 (permalink)
|
|
The Prestige
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
|
Quote:
Originally Posted by Village Idiot
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--;
} until($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);
}
|
What the crap? I didn't know "until" was part of the flow control. 
__________________
VillageIdiot can have my babbies ;d
|
|
|
|