#LOLCODE#
LOLCODE
25 characters
HAI 1.3
VISIBLE 1
KTHXBYE
###25 characters### HAI 1.3 VISIBLE 1 KTHXBYE ThisThis is a complete program that prints 1 to the standard output. ###24 characters### HOW IS I z 3 IF U SAY SO Defines
24 characters
HOW IS I z
3
IF U SAY SO
Defines a function z
that when called, returns 3.
###23 characters###
VISIBLE SUM OF a AN 32
23 characters
VISIBLE SUM OF a AN 32
22 characters
I HAS A var
GIMMEH var
###22 characters### I HAS A var GIMMEH var CreateCreate a variable and assign input to it. ###21 characters### VISIBLE “HAI WURLDZ!”
21 characters
VISIBLE “HAI WURLDZ!”
The LOLCODE Hello World Program!!! w00t w00t! ###20 characters### I HAS A big ITZ FAIL Creates
20 characters
I HAS A big ITZ FAIL
Creates a variable big
and assigns it to FAIL
, the falsy boolean.
###19 characters###
QUOSHUNT OF 99 AN 9
Returns
19 characters
QUOSHUNT OF 99 AN 9
Returns 11
, 99 divided by 9.
###18 characters###
I HAS A var ITZ 99
Creates
18 characters
I HAS A var ITZ 99
Creates variable var
and assigns it the value 99
, a NUMBR
.
###17 characters###
O RLY?
YA RLY
OIC
Similar
17 characters
O RLY?
YA RLY
OIC
Similar to the last snippet, this is a blank if statement. O RLY?
takes the value in IT
and tests it for truthiness. If true, it runs the code in the YA RLY
block, then exits at OIC
.
###16 characters###
WTF?
OMGWTF
OIC
A
16 characters
WTF?
OMGWTF
OIC
A switch/case statement. Takes the variable in IT
(the runtime temporary variable) and matches it up with any OMG <value>
statements. Since there are none, it goes right to OMGWTF
, the default statement. Since there is no code in the block, it goes right to OIC
and continues with the code.
###15 characters###
HAI 1.3
KTHXBYE
The
15 characters
HAI 1.3
KTHXBYE
The shortest complete program. All LOLCODE programs start with a version number and end with KTHXBYE. ###14 characters### DIFF OF 9 AN 6 Returns
14 characters
DIFF OF 9 AN 6
Returns the difference of 9 and 6 ###13 characters### CAN HAS TIME? Imports
13 characters
CAN HAS TIME?
Imports the library TIME if it exists. ###12 characters### GIMMEH INPTZ Gets
12 characters
GIMMEH INPTZ
Gets input from STDIN and saves it to the already-defined variable INPTZ. ###11 characters### OBTW C TLDR A
11 characters
OBTW
C
TLDR
A multi-line comment (C is the content) ###10 charaters### VISIBLE 10 Prints
10 charaters
VISIBLE 10
Prints 10 to STDOUT. ###9 characters### I HAS A Z Creates
9 characters
I HAS A Z
Creates a variable called Z. ###8 characters### VISIBLE
8 characters
VISIBLE
(note the trailing space) Prints… nothing. ###7 characters### HAI 1.3 The
7 characters
HAI 1.3
The hello()
of LOLCODE.
###6 characters###
GIMMEH
A
6 characters
GIMMEH
A function asking for input from STDIN. This does nothing as it's not assigned to a variable though. ###5 characters### Y R 6 Assigns
5 characters
Y R 6
Assigns the NUMBR
6 to the already-defined variable Y
###4 characters###
":)"
A
4 characters
":)"
A newline inside a YARN
. THE :
character is the escape character inside strings.
3 characters
BTW
###3 characters### BTW AnAn empty comment. w00t. ###2 characters### "" An
2 characters
""
An empty YARN
###1 character###
1 character
Factoid
###Factoid### IsIs composed almost completely with Internet slang.