99 Bottles on the Wall
|
- 99 bottles of beer on the wall,
-
- 99 bottles of beer.
-
- Take one down, pass it around,
-
- 98 bottles of beer on the wall.
-
- ...
- 2 bottles of beer on the wall,
- 2 bottles of beer.
- Take one down, pass it around,
- 1 bottle of beer on the wall.
- 1 bottle of beer on the wall,
- 1 bottle of beer.
- Take one down, pass it around,
- No more bottles of beer on the wall!
|
|
This song surprisingly serves as a test-bed for different languages.
Well, not too serious test-bed - but quite interesting! Take your
favourite language and try to implement the song.
Although it is not too difficult, your language (or you) must cope
with three different subtasks:
- cycling, iteration (99, ..., 2, 1)
- branching ('bottles' versus 'bottle')
- sequence
(you are not going to print all the text at once, aren't you)
If you are really interested, visit
web page
devoted entirely to '99 bottles'. The page contains
implementations of the song in almost 1500 different programming
languages and variations.
This group of languages contains:
- languages commonly regarded as programming languages,
e.g. C, C++, C#
- not so general programming languages, e.g.
C language preprocessor, Postscript, SAOL (music synthesis)
- programs which do not play the role of programming languages, e.g.
procmail, sed (unix stream editor)
|