Hubbry Logo
search
logo
LOLCODE
LOLCODE
current hub
1364101

LOLCODE

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
LOLCODE

LOLCODE is an esoteric programming language inspired by lolspeak, the language expressed in examples of the lolcat Internet meme. The language was created in 2007 by Adam Lindsay, a researcher at the Computing Department of Lancaster University.

The language is not clearly defined in terms of operator priorities and correct syntax, but several functioning interpreters and compilers exist. One interpretation of the language has been proven Turing-complete.

LOLCODE's keywords are drawn from the heavily compressed (shortened) patois of the lolcat Internet meme. Here follow a "Hello, World!" program and a simple program to output a file to a monitor. Similar code was printed in the Houston Chronicle.

In this example, commands to open a file (PLZ OPEN FILE "NAME"?—"Please open this file?"), and error handling (AWSUM THX—"Awesome, thanks!", and O NOES—"Oh no!") are introduced.

Other commands include I HAS A variable for declaring variables, variable R value ("variable [is/are/being] value") for assigning them, sending error messages to the front end via INVISIBLE instead of VISIBLE, and BTW ("by the way") to denote a comment, making the parser ignore the rest of the line.

Loops are created with IM IN YR label (inspired by the "Im in ur noun, verbing yr related noun" LOLcat meme), and ended with IM OUTTA YR label. Loops can be broken with the keyword ENUF ("enough"), or in older versions, GTFO. Loops can also be ended with the conditional IZ command, as demonstrated in the next example.

This simple program displays the numbers 1–11 and terminates (as of specification 1.0). The same program as of specification 1.2 is (assuming VAR starts at 0):

The above example will return the following:

See all
User Avatar
No comments yet.