Omgrofl
A small structured language whose keywords are internet slang, and whose variables are all spelled lol.
Juraj Borza, 2006 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Juraj Borza made Omgrofl in 2006. The name joins two slang words, omg and rofl. Every keyword is slang: rofl prints, stfw reads, tldr breaks out of a loop, stfu exits.
Read the story
Under the joke it is an ordinary little language. It has byte variables, an if, two kinds of loop and a deque that works as both a stack and a queue. The only rule for a variable name is that it is lol with some number of os: lol, lool, loool. Long programs end up with names like looooooooool, and counting the os is the real puzzle.
The machine
Byte variables (all start at 0, values wrap mod 256) and one deque. One statement per line; case does not matter.
| Statement | Does |
|---|---|
x iz y | Assign; x to /dev/null sets x to 0 |
lmao x, roflmao x | Add 1, subtract 1 |
rofl x, stfw x | Print x as a byte, read a byte into x (0 at end) |
n00b x | Push x onto the deque |
l33t x, haxor x | Pop from the top, take from the bottom (0 when empty) |
wtf x iz [nope] liek\|uber y ... brb | Run the block if x = y or x > y (nope negates) |
rtfm ... brb | Loop forever; tldr breaks out |
4 x iz a 2 b ... brb | Loop with x from a to b, stepping by 1, b included |
stfu, afk x, w00t | Exit, pause (does nothing here), comment |
An unknown statement stops the program.
Example
A cat.
A cat. rtfm starts an endless loop. stfw lol reads a byte, and at the end of input that byte is 0, so wtf ... tldr leaves the loop. Otherwise rofl lol prints it.
Patterns it teaches
- Stack machines: the deque gives both a stack and a queue.
- Turing completeness: the queue can act as a Turing machine's tape.
Try this
- Print
Hiwith one variable. - Use a
4loop to print the lettersatoz. - Hard: read a line and print it backwards with
n00bandl33t.
Further
See also
Queue-based
Stack-based
Write your own in Run Convert a program from Omgrofl
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: omgrofl.
Command line
shib run omgrofl -e 'rtfm
stfw lol
wtf lol iz liek 0
tldr
brb
rofl lol
brb' --input 'hi'shib manual omgroflSource
- Module
langs/stack/ports.js- Interpreter
langs/stack/omgrofl.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org