0
How to do "99 Bottles of Beer" in JavaScript?
en.wikipedia.org/wiki/99_Bottles_of_Beer
2 Answers
+ 6
Interesting. :>
There, the pseudocode is already in the wiki article.
FOR Bottle = 100 TO 1 STEP -1
PRINT STR(Bottle) +" bottles of beer on the wall, "+ STR(Bottle) +" bottles of beer"
PRINT "Take one down and pass it around, "+ STR(Bottle-1) +" bottles of beer on the wall"
NEXT Bottle
Just translate it to JavaScript after comprehending the contents. You have a for loop which counts from 100 to 1. Print the verse along with the decrementing counter.
+ 3
you can also check out on this site: http://www.99-bottles-of-beer.net