View Single Post
Old 05-04-2009, 03:52 AM   #4 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Village Idiot View Post
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
Orc is offline  
Reply With Quote