cutiepatootiebear / 99-Bottles-of-Juice-using-while-loop

Write a loop that prints out the following song. Starting at 99, and ending at 1 bottle. 99 bottles of juice on the wall! 99 bottles of juice! Take one down, pass it around... 98 bottles of juice on the wall! 98 bottles of juice on the wall! 98 bottles of juice! Take one down, pass it around... 97 bottles of juice on the wall! ... 2 bottles of juice on the wall! 2 bottles of juice! Take one down, pass it around... 1 bottle of juice on the wall! 1 bottle of juice on the wall! 1 bottle of juice! Take one down, pass it around... 0 bottles of juice on the wall! Some Notes: Note the pluralization of the word "bottle" when you go from 2 bottles to 1 bottle. Your text editor may try to autocorrect your ellipses ... to the ellipses character … Do not use the ellipses character for this quiz.
0 stars 0 forks source link

DRY #1

Open basketofsoftkittens opened 6 years ago

basketofsoftkittens commented 6 years ago

https://github.com/cutiepatootiebear/99-Bottles-of-Juice-using-while-loop/blob/260ca9bbb88b7aac3206c64f6f82350936027e62/scripts.js#L14

Do you remember the DRY principle? whats a good application of it with this code?

basketofsoftkittens commented 6 years ago

i mean the code inside of the while loop. not just that one conditional