# Talk:99 Bottles of Beer

WikiProject Songs (Rated C-class)
This article is within the scope of WikiProject Songs, a collaborative effort to improve the coverage of songs on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
C  This article has been rated as C-Class on the quality scale.

## Use in computer science

I am deleting this silly claim:

Writing a 99 Bottles of Beer computer program, which outputs the lyrics to the song algorithmically, is a programming exercise; getting the plural correct in the final counting ("1 bottle of beer on the wall") can be awkward.

Awkward? Why? An implementation in pretty much any imperative language would look something like this C example:

```  for (i=100; i>=0; i--) {
if (i==1) {
printf("1 bottle of beer on the wall.\n");
} else {
printf("%d bottles of beer on the wall.\n", i);
}
}
```

or, somewhat more elegantly,

```  for (i=100; i>=1; i--) {
printf("%d bottle%s of beer on the wall.\n", i, (i!=1 ? "s" : ""));
}
```

This is hardly rocket science. --Saforrest 04:24, 10 May 2006 (UTC)

I agree the statement should be deleted, not notable enough. However, it can be a good programming exercise for beginning programming courses, when students are first taught about iterative loops. I remember it from my fifth grade BASIC course (on an Apple II in 1980 or so). For them, the conditional would be an additional challenge. 69.95.235.18 (talk) 14:26, 5 June 2008 (UTC)
How is this not notable? It is a VERY common programming exercise. The trivia section is already now extremely huge! Usage in programming is much more relevant than most of the current trivia. Ran4 (talk) 09:21, 22 November 2009 (UTC)

I disagree. A program to print all verses of 99 bottles demonstrates at least two computer science principles: decrementing variables properly and compiler dependency. When singing the song, the "bottle count" variable is decremented in the middle of the verse, not at the end. Therefore, while it is tempting to use a for-loop that automatically decrements the bottle count, it is better to use a while loop that decrements the bottle count variable at the right time, i.e.

int count=99;

while (count > 0) {

System.out.println (count + "bottles of beer");

count--;

System.out.println ("If one of those bottles should happen to fall, there'd be " + count + "bottles of beer on the wall");

}

Properly understanding pre- and post-decrement operators one can dispense with the count-- line and say either (count-- + "bottles of beer") or "there'd be " + --count + "bottles of beer on the wall".

Also, if one tries to be more elegant, and puts the whole verse on one line, we end up with a compiler-dependent uncertainty (switching from Java to C):

while (count > 0) { printf ("%d bottles of beer on the wall\n %d bottles of beer\n If one of those bottles should happen to fall, there'd be %d bottles of beer on the wall\n\n",count, count, --count); }

The output of this one-line solution depends on the compiler, specifically whether it parses and evaluates variables in a line from left to right or right to left. I will dispense with adjusting the word "bottles" for plurality as mentioned above, and note that the above for-loop examples would start the song with "100 bottles of beer on the wall..." with the post-decrement operator used.108.225.17.141 (talk) 18:00, 15 October 2013 (UTC)

## Ten in a bed

I've heard this as "bears in a bed," with the final line being "I'm lonely!" I woulds guess I heard it on Sesame Street, but I'm not sure. Шизомби 22:57, 11 May 2006 (UTC)

I think maybe you're referring to the one:
"Ten in the bed,
And the little one said,
'Move over! Move over!'
And they all moved over and one fell out!
(down to one)
One in the bed
And the little one said,
'I'm lonely!'"
-SigPig 01:46, 21 August 2006 (UTC)

Same song, but, with slightly different lyrics. Instead of 'move over,' I've heard it as 'roll over.'

## 65635 bottles of beer on the wall

Hahahah - hilarious. Although it got reverted it deserves its place in WP:BJODN

• A even more nerdish variant play with a misinterpretation of the negative notation of an integer in a computer memory : "0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 65635 bottles of beer on the wall..." - 213.56.79.220

JameiLei 21:13, 17 April 2007 (UTC)

## Source of "99 Kettles of Soup" variant

I'm pretty sure this one came from an episode of "Garfield and Friends", but not knowing which episode, I can't cite it. Can anyone corroborate? (Or find an earlier example?) I'm sure it was used in the show, though, even if it existed earlier. Lurlock (talk) 16:53, 24 November 2007 (UTC)

"99 Kettles of Soup" was sung in Garfield and Friends Season 4 Episode 65 entitled "Speed Trap" which originally aired 10/5/91

Source: www.tv.com — Preceding unsigned comment added by 207.172.200.31 (talk) 01:33, 7 November 2014 (UTC)

## More Variants

I don't have any sources for these, but others may have heard this.

1) When returning to 99, "Go to the store and buy some more" doesn't fit rhythmically. I've always heard it as "Go to the store and pick up some more". However, I'm not sure if "to pick up something at the store" is a colloquialism.

2) It is possible to take more than one bottle off the wall: "Take 10 down, pass them around". Combined with the ability to pick any number up at the store, even if you haven't taken all of them down, you can jump quickly between numbers. Of course, this gets old a lot quicker. 69.95.235.18 (talk) 14:34, 5 June 2008 (UTC)

Re: #2 - you can 'take down' as many as you like - that's irrelevant - it's not part of the song, and the song's whole purpose is a 'time killer,' so, be that as it may, why would anyone even think of such as taking multiple bottles? By the same token - one could say, "I don't drink, I'm in recovery, there's still x bottles of beer on the wall,' or any such nonsense. It's pointless.

## Variants?

This article mentions similar songs such as Ten Green Bottles and Ten in the Bed as variants of 99 Bottles of Beer, but it is probably the other way round. — Chameleon 01:40, 13 July 2008 (UTC)

## Bugs in the Code

Another variation, involving fixing bugs in a computer program:

99 little bugs in the code
99 little bugs
Fix one of them, compile it again
100 little bugs in the code

The song continues infinitely, unless it is chosen to decrease the number of code errors instad of increasing them. —Preceding unsigned comment added by Gabso94 (talkcontribs) 01:42, 17 August 2008 (UTC)

I've always thought it sounded better with the third line being "track one down, patch it around..." and then I've typically used more than 100 bugs (like 112 or something)... I almost think this deserves some sort of reference in the "Science" section, especially since the "Science" section only deals with computer science anyways Brettpeirce (talk) 18:25, 10 March 2016 (UTC)

## Danish variant?

There's a 99 Bottles of Milk song in the film Vikaren (2007) AKA The Substitute. Шизомби (talk) 22:22, 21 November 2008 (UTC)

## 99 Bottles of Beer (http://www.99-bottles-of-beer.net/)

Should this be edited in for mention of its value as a programming-language teaching tool? [It does add simple loops/iteration to Hello World's display statements? It belongs in external links, sure, but I think it could use a small section of the main body of the article as well. KingAlanI (talk) 19:16, 26 December 2008 (UTC)

## The song itself

The song lyrics do not appear in the article at all. This is surprising especially becaues other songs' lyrics apppear in the article. Why? CarVac (talk) 16:12, 31 October 2009 (UTC)

done. Vinithehat (talk) 16:33, 31 October 2009 (UTC)

What about the origin of this song? I heard someone in the middle ages that was about to be executed was asked if he had any last words, and he sung a variant of this song, and that's how it got invented. The snare (talk) 21:01, 21 June 2010 (UTC)

## another variant

"if one of those bottles should happen to fall" vice "take one down, pass it around" 165.91.64.216 (talk) 05:10, 19 March 2010 (UTC)RKH