LOLCODE

From Esolang
Jump to: navigation, search
This article is a stub, which means that it is not detailed enough and needs to be expanded. Please help us by adding some more information.

LOLCODE is a general-purpose programming language being developed to resemble the kitty pidgin natlang of the lolcat phenomenon. It was created in 2007, one year after LOLCATS became an Internet meme.

Keywords[edit]

These are the main keywords. All LOLCODE is written in uppercase.

Code Comment
HAI In all LOLCODE programs, HAI introduces the program.
BTW Comment Introduces a comment.
CAN HAZ STDIO? Includes the library STDIO.
VISIBLE [STRING] Prints STRING to the standard output stream.
COMPLAIN [STRING] Prints STRING to the standard error stream.
I HAZ A [VAR] ITZ [VALUE] Declares a variable and assigns a value to it.
LOL [VAR] R [VALUE] Another way of assigning a value to the variable.
IZ [VAR] [OPERATOR] [VALUE]?
	YARLY
		...SOMECODE
		KTHX
	NOWAI
		...SOMECODE
		KTHX
An if statement (spec 1.0). OPERATOR can be BIGR THAN (>), SMALLR THAN (<) or LIEK (==).
IM IN YR LOOP
	...SOMECODE
       KTHX
IM OUTTA YR LOOP
Runs the same code in the "IM IN YR LOOP" code block until it goes to a "KTHX" instruction in the code block. An "IM IN YR LOOP" code block which never goes to a "KTHX" instruction causes an infinite loop.
KTHXBYE KTHXBYE terminates the program.

External resources[edit]