# 99 Bottles of Beer class BottlesOfBeerSong def pluralize(count as int) as String if count == 1 return "" else return "s" def beer(bottles as int) as String if bottles == 0 return "No more" else if bottles == -1 return "99" else return bottles.toString def bottlesOfBeer(bottles as int) as String return .beer(bottles) + " bottle" + .pluralize(bottles) + " of beer" def onTheWall(bottles as int) as String return .bottlesOfBeer(bottles) + " on the wall" def bottleFall(bottles as int) as String if bottles == 0 return "Go to the store and buy some more, " else return "Take one down and pass it around, " def main for bottle as int in 99 : -1 : -1 print .onTheWall(bottle) + ", " + .bottlesOfBeer(bottle) + "," print .bottleFall(bottle) + .onTheWall(bottle-1) + "." print