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

99 bottles, 2 lines -Didnt login- hehe

by Extreme66 (Initiate)
on Nov 10, 2002 at 04:25 UTC ( #211715=note: print w/replies, xml ) Need Help??

in reply to 99 bottles, 2 lines

$a='on the wall';$b=99;$c="bottles of beer";do{print"$b $c $a, $b $c\nTake one down, pass it around\n$b $c $a!\n\n"}while(($b--)>0)

Replies are listed 'Best First'.
Re: 99 bottles, 2 lines -Didnt login- hehe
by Anonymous Monk on Aug 04, 2003 at 00:28 UTC
    got it even smaller (126 bytes)

    @a=(" bottles of beer",'on the wall ');die map{"$_@a$_$a[0]\nTake one down, pass it around\n".(--$_||No)."@a\n"}reverse(1..99)
      oh no... forgot to login too *g*
        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";

Re: 99 bottles, 2 lines -Didnt login- hehe
by ambrus (Abbot) on Dec 15, 2011 at 16:32 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://211715]
[stevieb]: I'm checking some other versions. This is a little frightening
[pryrt]: Sorry, my bad: it was't done downloading when I did the sha1sum... now I match your 309ad... value
[stevieb]: I'll see how to get in touch with someone and advise that there's an issue. Thanks for helping me confiirm pryrt!
[pryrt]: also mismatches; but matches their sha1

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2017-03-29 21:04 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (353 votes). Check out past polls.