0

How to do "99 Bottles of Beer" in JavaScript?

en.wikipedia.org/wiki/99_Bottles_of_Beer

7th May 2018, 10:28 AM
SLdiedin2018
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.
7th May 2018, 1:46 PM
Hatsy Rei
Hatsy Rei - avatar
+ 3
you can also check out on this site: http://www.99-bottles-of-beer.net
7th May 2018, 2:36 PM
đŸ€– Basile Laderchi