Johan Åhlén

Johan Åhlén's blog about life, universe and everything.

99 bottles of beer

The website 99 bottles of beer shows how to write the lyrics of the song, with the same name, in about 1300 different programming languages. I've now made a contribution written in SQL. Here's the lyrics of the song:

99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.
[Yet another 98 verses]
No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall.

99 bottles of beer has grown into a phenomena. Basically you find three categories of example on the internet for new languages: Hello World-programs, Quines (programs printing their own source code) and 99 bottles of beer-programs. It's amazing to see how much effort has been spent on some examples on the 99 bottles of beer website. Challenge: can you write a Quine in SQL?

One of my personal favorites from 99 bottles of beer is Shakespeare, a programming language with a "poetic freedom". Programs are divided in Acts and Scenes. The characters in the play are variables. If you want to assign a character, let's say Hamlet, a negative value, you put him and another character on the stage and let that character insult Hamlet. Input and output is done be having someone tell a character to listen their heart and speak their mind. Why make things simple when you can make them beautifully complicated? ;-)

Cheers - it's friday!

Posted: Oct 09 2009, 03:45 PM by jahlen
Filed under: , ,


No Comments