export class BeerSong {
static recite(initialBottles, takeDown) {
const verses = [];
for (let i = 0; i < takeDown; i++) {
const n = initialBottles - i;
if (n === 0) {
verses.push("No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n");
} else if (n === 1) {
verses.push("1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n");
} else if (n === 2) {
verses.push("2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n");
} else {
verses.push(`${n} bottles of beer on the wall, ${n} bottles of beer.\nTake one down and pass it around, ${n - 1} bottles of beer on the wall.\n`);
}
}
return verses.join('\n');
}
}