Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: 99 bottles, 2 lines -Didnt login- hehe

by Anonymous Monk
on Dec 03, 2003 at 23:01 UTC ( [id://312038]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: 99 bottles, 2 lines -Didnt login- hehe
in thread 99 bottles, 2 lines

129, and properly decrements the count inside of the verse

$i=99;$b="bottles of beer";$o=" on the wall";while($i){print "$i $b$o, $i $b\nTake one down, pass it around\n",--$i," $b$o!\n\n"}

186, but accounts for the fact that you would say 1 bottle but still say 0 bottles.

$i=99;$f=" of beer";$o=" on the wall";while($i){$b="bottle";$b.="s"if$i!=1;print" $b$f$o\n\n"if$i!=99;print"$i $b$f$o, $i $b$f\nTake one down, pass it around, ",--$i}print" ${b}s$f$o\n";

--Gilder

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://312038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-04-19 14:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found