LOLcode Shirt

nerdy-shirt
Click on the image above to zoom.

LOLcode is a humorous programming language inspired by LOLcats. There are now Python interpreters of LOLcode, a managed LOLcode.NET compiler, and LOLcode programming competitions.

We created these shirts to show off not only the attitude of LOLcode, but some actual working LOLcode showing the hilarious syntax. That's just how we LOL!

I CAN HAS N CHEEZBURGER K?

The back of these shirts feature a function definition in LOLcode. It is a working function which efficiently computes the binomial coefficient N choose K, iteratively computing N choose I for I = 0 through K. This avoids overflows when computing coefficients such as 100 choose 5 = 100! / (5! 95!) using 32 bit arithmetic.

The syntax of LOLcode resembles the captions of LOLcat pictures. The function header is "HOW DUZ I CHUZ YR N AN YR K" which defines a function called CHUZ taking parameters N and K; it is closed by "IF U SAY SO". The variable NCHUZK is defined and initialized to 1 (N choose 0) by the line "I HAS A NCHUZK ITZ 1". "LOL COUNT R 0" is an alternative way to set the variable COUNT to 0. An infinite loop is started by "IM IN YR LOOP" and closed by "KTHX". The function returns the value NCHUZK in the line "FOUND YR NCHUZK". BTW introduces a comment. "OVARZ NCHUZK!!COUNT" divides the variable NCHUZK by the variable COUNT. Similarly, "NERF N!!" decreases N by 1.