Learn Lolcode - 10 Code Examples & CST Typing Practice Test
LOLCODE is an esoteric programming language designed to resemble the syntax and grammar of 'lolspeak', the internet meme language used by LOLcats. It is intended as a humorous, educational, and experimental programming language.
Learn LOLCODE with Real Code Examples
Updated Nov 26, 2025
Code Sample Descriptions
Hello World in LOLCODE
HAI 1.2
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
The canonical LOLCODE 'Hello World!' program.
Simple Addition
HAI 1.2
I HAS A NUM1 ITZ 5
I HAS A NUM2 ITZ 10
I HAS A SUM
SUM R SUM OF NUM1 AN NUM2
VISIBLE SUM
KTHXBYE
Adds two numbers and prints the result.
Simple Subtraction
HAI 1.2
I HAS A NUM1 ITZ 10
I HAS A NUM2 ITZ 4
I HAS A DIFF
DIFF R NUM1 MINUS NUM2
VISIBLE DIFF
KTHXBYE
Subtracts one number from another and prints the result.
Check Even Number
HAI 1.2
I HAS A NUM ITZ 6
BOTH SAEM NUM MOD 2 AN 0, O RLY?
YA RLY
VISIBLE "YES"
NO WAI
VISIBLE "NO"
OIC
KTHXBYE
Checks if a number is even and prints YES or NO.
Check Odd Number
HAI 1.2
I HAS A NUM ITZ 7
BOTH SAEM NUM MOD 2 AN 1, O RLY?
YA RLY
VISIBLE "YES"
NO WAI
VISIBLE "NO"
OIC
KTHXBYE
Checks if a number is odd and prints YES or NO.
Simple Multiplication
HAI 1.2
I HAS A NUM1 ITZ 3
I HAS A NUM2 ITZ 4
I HAS A PROD
PROD R NUM1 TIMES NUM2
VISIBLE PROD
KTHXBYE
Multiplies two numbers and prints the result.
Simple Division
HAI 1.2
I HAS A NUM1 ITZ 20
I HAS A NUM2 ITZ 5
I HAS A QUOT
QUOT R NUM1 DIVIDEDBY NUM2
VISIBLE QUOT
KTHXBYE
Divides one number by another and prints the result.
Factorial Function
HAI 1.2
I HAS A NUM ITZ 5
HOW IZ FACT YR NUM
NUM SMALLR 1, O RLY?
YA RLY
VISIBLE 1
NO WAI
VISIBLE NUM TIMES FACT NUM BIGGR 1
OIC
VISIBLE FACT NUM
KTHXBYE
Computes factorial of a number using recursion.
Fibonacci Sequence
HAI 1.2
I HAS A A ITZ 0
I HAS A B ITZ 1
I HAS A TEMP
VISIBLE A
VISIBLE B
IM IN YR LOOP N TIMES 8
TEMP R A PLUS B
VISIBLE TEMP
A R B
B R TEMP
IM OUTTA YR LOOP
KTHXBYE
Prints the first few Fibonacci numbers using LOLCODE.
Maximum of Two Numbers
HAI 1.2
I HAS A NUM1 ITZ 10
I HAS A NUM2 ITZ 15
BOTH SAEM NUM1 BIGGR THAN NUM2, O RLY?
YA RLY
VISIBLE NUM1
NO WAI
VISIBLE NUM2
OIC
KTHXBYE
Finds and prints the maximum of two numbers.
Frequently Asked Questions about Lolcode
What is Lolcode?
LOLCODE is an esoteric programming language designed to resemble the syntax and grammar of 'lolspeak', the internet meme language used by LOLcats. It is intended as a humorous, educational, and experimental programming language.
What are the primary use cases for Lolcode?
Educational demonstrations of syntax and programming concepts. Fun coding projects and memes. Experimentation with esoteric language design. Introducing programming concepts in a playful manner. Artistic or internet culture-inspired coding
What are the strengths of Lolcode?
Highly readable and humorous syntax. Great for teaching basic programming concepts. Encourages playful experimentation. Easy to set up with interpreters. Cross-platform and open-source interpreters available
What are the limitations of Lolcode?
Not suited for production or serious software development. Limited standard library and I/O capabilities. Performance and efficiency are minimal concerns. Interpreters vary in implementation and compatibility. Complex programs become cumbersome and unreadable
How can I practice Lolcode typing speed?
CodeSpeedTest offers 10+ real Lolcode code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.