LOLCODE
From Esolang
- 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.
[edit] Keywords
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.
|
[edit] External resources
- Main site.
- 99 bottles of beer. On August 3, 2007 LOLCODE was the top rated entry on the 99 bottles of beer site.
- Extensive article on Wikipedia.