What Is LOLCODE?

From the LOLCODE Article on Wikipedia:

LOLCODE is a humorous esoteric programming language heavily inspired by structures found in many common programing languages, as modified to be expressed via common terms, stylings and informal spellings found in Internet memes (primarily lolcats) and the communication style found in internet slang, instant messenger chat, and cellphone text messaging ("TXT"), rather than the numerically-based l33t. The name itself comes from the expression "LOL".

An example of the classic Hello World program in LOLCODE:

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

A simple program that prints the numbers 0 - 9 then terminates:

HAI
CAN HAS STDIO?
IM IN YR LOOP UPPIN YR VAR TIL BOTH SAEM VAR AN 10
    VISIBLE VAR
IM OUTTA YR LOOP
KTHXBYE

As of specification 1.2, LOLCODE supports the following:

  • variables with limited scope (current function, block)
  • variable types: untyped, boolean, integers, floats, strings
  • variable type casting
  • math operators: +. -. *, /, mod, max, min
  • boolean operators: and, or, xor, not
  • comparison operators: eq, neq, leq, le, geq, ge
  • basic input/output to stdin/stdout
  • flow control structures: if-then-else, switch-case
  • loop structures: while-do, until-do
  • functions: fixed argument count

LOLCODE also has a few oddities:

  • Expressions are written using prefix notation.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License