In this quiet time after Christmas, when things start to calm down to where they should be, thoughts often turn to that most relaxing of pastimes: programming languages.

The traditional way of testing a programming language is to have it write out “Hello, world”.  One site extends the concept and develops it a little, having the programs write out the whole lyrics to the fabled travelling song, 99 bottles of beer on the wall.

And they’re serious.  As I write this, there are submissions in over thirteen hundred different languages.  Some of the languages are silly and serve no other purpose than showing off (see Whitespace) and others are ridiculous and serve no other purpose than annoying your computer professor (see Malbolge, with its programming in base 94 but counting in trinary).

I personally like the Rexx language, and prefer this submission over this one.  The first retains the flavor of Rexx, where the second one could be almost any programming language (except Intercal).

But nothing – NOTHING – has the flavor of LOLCODE.  LOLspeak has been made popular by ICanHasCheezburger, where cats reveal their true thoughts, complete with misspellings.  LOLCODE turns that way of talking into a programming language.  The “Hello, world” is a model of simplicity:

HAI
CAN HAS STDIO?
VISIBLE “HAI WORLD!”
KTHXBYE

The beer bottle song made me laugh, from the “by the way” comments to the YARLY/NOWAI true/false split :

BTW LOLCODE version of 99 Bottles of beer
BTW By Mike Gogulski (http://www.gogulski.com/) 13 July 2007
BTW LOLCODE is a programming language by and for lolcats
BTW http://www.lolcode.com/
BTW
BTW Tested with:
BTW   sjlol version 1.1 for lolcode 1.0
BTW     Win32 binary: http://www.rit.edu/~sjl7678/sjlol.zip
BTW     Home: http://lolcode.com/implementations/sjlol
BTW     Online interpreter: http://wealhtheow.rh.rit.edu:8080/index
BTW       (Doesn't work with comments, so delete all "BTW" lines)
BTW
BTW Save as 99BOTTLZ.LOL, start with "sjlol 99bottlz.lol"
BTW
BTW LOLCATZ CNT SPEL 2 GUD
BTW
HAI
    VISIBLE "O HAI! IM IN UR BEERZ!"
    I HAS A VAR
    LOL VAR R 99
    IM IN YR LOOP
        VISIBLE VAR!
        VISIBLE " BOTTLZ OF BEER N TEH WALL, "!
        VISIBLE VAR!
        VISIBLE " BOTTLZ OF BEER!"
        VISIBLE "TAKE 1 DWN, PAS IT AROUN, "!
        NERFZ VAR!!
        IZ VAR LIEK 0?
            YARLY
                VISIBLE "NO MOAR"!
            NOWAI
                VISIBLE VAR!
        KTHX
        VISIBLE " BOTTLZ OF BEER N TEH WALL!"
        IZ VAR LIEK 0?
            GETOUT
        KTHX
    KTHX
    VISIBLE "GIEV MOAR PLZ! KTHXBAI!"
KTHXBYE
Advertisements