05-04-2009, 03:50 AM
|
#2 (permalink)
|
|
Wizard
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
|
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);}
|
|
|
|