< Back to reference


OMGROFL

Legend:
omgrofl code basic syntax or notes
* omgrofl code is not case sensitive.

w00t

Standard comment line. Any text following w00t is ignored.

For example:
w00t rofl lol funny! [ 'rofl lol funny! ]
lol iz 10 w00t yeah! [ lol = 10 'yeah! ]

lol

And variants
Variable name.
Values in the code may only be assigned to variables, and must be in the form of LOL, with any length of "O" (for example lol, lool, looooooool, etc), each being considered a different variable.

iz

Assign a value to a variable. Also used within conditional statements (see below).

Proper assignment syntax is:
lol iz value

For example, to set variable values:
lol iz 10 [ lol = 10 ]
lool iz 15 [ lool = 15 ]
loooooool iz 208 [ loooooool = 208 ]

brb

Generic end or break command marking the tail end of a block of statements to be executed in a loop. It's used with WTF, RTFM, and the conditional "4" loop. (see below for contexts)

wtf, liek, uber, nope

WTF is a conditional statement, like basic's "if...end if". There is no "else" equivalent, however. Any statements between WTF and BRB are executed only if the condition is met.

Conditional expressions include LIEK, UBER, and NOPE.

IZ LIEK: values are equivalent
IZ UBER: first value is greater than the second
IZ NOPE...: NOT; inverse the following condition

For example, to compare variables to values:
wtf lol iz liek 10 [ if lol = 10 then ]
...
brb [ end if ]

wtf loool iz nope uber 15 [ if not( loool > 15 ) then ] 'or <= 14
...
brb [ end if ]

lmao, roflmao

LMAO increases a variable by 1.
ROFLMAO decreases a variable by 1.

For example, to set, increment, and decrement a variable:
lool iz 10 [ lool = 10 ]
lmao lool [ lool = lool + 1 ]
roflmao lool [ lool = lool - 1 ]

rofl

Print the ascii character (single byte) equivalent of a value or variable.

For example, to output "ABC xyz":
rofl 65 [ print chr(65) ] "A"
rofl 66 [ print chr(66) ] "B"
rofl 67 [ print chr(67) ] "C"
rofl 32 [ print chr(32) ] " "
lol iz 120 [ lol = 120 ]
rofl lol [ print chr(lol) ] "x"
lmao lol [ lol = lol + 1 ]
rofl lol [ print chr(lol) ] "y"
lmao lol [ lol = lol + 1 ]
rofl lol [ print chr(lol) ] "z"

rtfm, tldr

RTFM is a basic indefinite loop, executing any commands between RTFM and BRB repeatedly.
TLDR is the equivalent of a break command, to exit a loop.

For example, to perform a loop 10 times:
lol iz 1 [ lol = 1 ]
rtfm [ do / while true ]
...
wtf lol iz 10 [ if lol = 10 then ]
tldr [ exit do / exit while ]
brb [ end if ]
lmao lol [ lol = lol + 1 ]
brb [ loop / wend ]

4...iz...2...

This is the conditional loop, executing commands between 4 and BRB until the condition is met.
Proper syntax is:
4 (variable) iz (initial value) 2 (end value)

If the initial value is less than the end value, the variable is increased after each iteration. If the initial value is greater than the end, the variable is decreased after each iteration.
TLDR may be used to exit the loop.

For example, to print "EDCBA" and stop after "A" is printed:
4 lol iz 69 2 60 [ for lol = 69 to 60 step -1 ]
rofl lol [ print chr(lol) ]
wtf lol iz liek 65 [ if lol = 65 then ]
tldr [ exit for ]
brb [ end if ]
brb [ next ]

stfw

Input a value into a variable. Depending on the context the code is being executed, this could be reading a byte from a file, or requesting a character/value from the user or interface.

For example:
stfw lol [ lol = (received value) ]

n00b, l33t, haxor

Stack/Queue management. The stack is a first-in-last-out array of values that can pushed and popped. Consider a measuring tape - If you add an inch to its length (push), you get that same inch back when you retract (pop) in the same order until the first inch you added.
Values can however be removed from the high end of the stack - dequeued.
Sample stack:
push A ("A")
push B ("BA")
push C ("CBA")
push D ("DCBA")
pop value (returns "D" from the low end leaving "CBA")
dequeue value (returns "A" from the high end leaving "CB")

N00B: Push a value into the stack/queue.
L33T: Pop a value from the stack into a variable. If the stack is empty, 0 is stored in the variable.
HAXOR: Dequeue a value from the stack into a variable. If the stack is empty, 0 is stored in the variable.

For example, to print "XYZ", ignoring A, B, and C (with B removing the extra Z), and stopping when there are no more values in the stack:
n00b 82 [ 'stack 82 ] "Z"
n00b 67 [ 'stack 67 ] "C"
n00b 82 [ 'stack 82 ] "Z"
n00b 66 [ 'stack 66 ] "B"
n00b 81 [ 'stack 81 ] "Y"
n00b 65 [ 'stack 65 ] "A"
n00b 80 [ 'stack 80 ] "X"
rtfm [ do ]
l33t lool [ 'pop into lool from the stack ]
wtf lool iz 0 [ if lool = 0 then ]
tldr [ exit do ]
brb [ end if ]
wtf lool iz uber 79 [ if lool > 79 then ] 'only if X, Y, or Z
rofl lool [ print chr(lool) ]
brb [ end if ]
wtf lool iz 66 [ if lool = 66 then ] 'only if B
haxor lool [ 'remove the last stack value (Z) ]
brb [ end if ]
brb [ loop ]

stfu

STFU ends the program execution immediately.

afk

AFK pauses program execution for a number of milliseconds.

For example:
afk 1500 [ 'pause for 1.5 seconds ]

Additional Notes

lol to /dev/null is equivalent to lol iz 0

Complex mathematical equations are not simple in omgrofl.
For example, to add two values, 3 and 5, into a new variable (eg z = x + y), a loop must execute 5 times, adding 1 each time:
lol iz 3 [ lol = 3 ]
lool iz 5 [ lool = 5 ]
loool iz lol [ loool = 3 ] 'output variable
looooool iz lool [ looooool = 5 ] 'counter
rtfm [ do ]
wtf looooool iz liek 0 [ if looooool = 0 then ]
tldr [ exit do ]
brb [ end if ]
lmao loool [ loool = loool + 1 ]
roflmao looooool [ looooool = looooool - 1 ]
brb [ loop ]
[ 'loool now contains value 8 ]

Alternatively, as a conditional loop (note: unsure if variables can officially be used in the 4...brb loop):
lol iz 3 [ lol = 3 ]
lool iz 5 [ lool = 5 ]
loool iz lol [ loool = 3 ]
4 looool iz lol 1 2 lool [ for looool = 1 to 5 ]
lmao loool [ loool = loool + 1 ]
brb [ next ]
[ 'loool now contains value 8 ]