Skip to content

LAU Syntax & Variables

Lau is an easy-to-write and readable language. You don’t need to put semicolons (;) at the end of lines. The Lau language is designed being inspired by the Lua language.

Use comments to leave notes in your code. The system ignores these lines.

-- This is a single-line comment.
varol x = 1 -- Code is here.
--[[
This is a multi-line
comment block.
]]

The following words belong to the language itself and cannot be used as variable names:

varol, func, if, else, elseif, then, end, for, while, do, break, continue, return, req, true, false, null, inpairs, and, or, not

Example - Incorrect vs Correct:

-- ERROR! This code will not work:
varol if = 5
-- CORRECT:
varol ifStatus = 5

Inside Lau, Turkish Characters (ö, ğ, ş, ç, ı, ü), Emojis, and special characters are strictly forbidden. These characters cannot be read by the system and will be replaced by a "?" sign, which causes the code to break and error out.

-- ERROR! Unreadable and results in a "?" error:
varol lauöğreniyorum = 2
-- CORRECT:
varol learningLau = 2

In the Lau language, code blocks (if, for, while, func) are not defined by curly braces ''. Instead, they must always be closed using the end keyword. Every structure you open with then or do requires a matching end.

When you place a block inside another (Nested), each block must have its own end. The first end closes the innermost block, and the last end closes the outermost block.

varol energy = 100
varol isMoving = true
-- Outer block starts
if energy > 0 then
-- Inner block starts
if isMoving == true then
print("Robot is moving and has energy.")
end -- Closes inner 'if'
end -- Closes outer 'if'
-- This rule applies to all structures:
for i = 1, 3 do
while true do
break
end -- Closes while
end -- Closes for

Variables store information. In LAU, every new variable must start with the varol keyword.

lau-compiler.exe
varol name = "Lau" -- String (Text)
varol level = 5 -- Number
varol active = true -- Boolean (Logical)
varol list = {1, 2, 3} -- List
-- Value update
level = 6
level += 1 -- (Same as level = level + 1)
print(level)
OUTPUT:
6

Lau supports the following data types:

  1. Number: Whole or decimal numbers. Square roots or factorials of negative numbers cannot be calculated.
  2. String: Texts within double quotes. Maximum 10,000 characters. Automatically performs concatenation when added with numbers ("Lau " + 2).
  3. Boolean: Takes only true or false values. Used in decision mechanisms (if).
  4. List: Ordered (Array) or keyed (Dictionary) boxes that can hold up to 5,000 elements.
  5. Enum: E.g., Enum.Direction.North. Can only be checked for equality with other Enums in its own category.
  6. Null: Represents empty data with no value.

Used to perform mathematical operations with numbers:

OperatorActionExampleResult
+Addition5 + 38
-Subtraction10 - 46
*Multiplication3 * 412
/Division20 / 210
^Exponentiation2 ^ 38
%Modulo/Remainder10 % 31
#Square Root#42
lau-compiler.exe
varol x = 10
varol y = 5
varol result = (x + y) * 2 -- Parentheses have priority
print(result) -- Prints 30
OUTPUT:
30

Compares two values and returns true or false as a result:

OperatorMeaning
==Equals
~=Not Equal
<Less Than
>Greater Than
<=Less Than or Equal
>=Greater Than or Equal
lau-compiler.exe
varol energy = 100
if energy == 100 then
print("Energy is full!")
end
if energy ~= 0 then
print("Still working...")
end
OUTPUT:
Energy is full! Still working...

The Lau language has special ‘and Assign’ operators to shorten operations:

OperatorMeaningExample
=Standard Assignmentx = 5
+=Add and Assignx += 1 (same as x = x + 1)
-=Subtract and Assignx -= 5
*=Multiply and Assignx *= 2
/=Divide and Assignx /= 2
^=Power and Assignx ^= 2
%=Modulo and Assignx %= 3
lau-compiler.exe
varol score = 0
-- Long way
score = score + 10
-- Shorthand (Lau Style)
score += 10
print(score) -- Prints 20
OUTPUT:
20

LAU uses uppercase keywords for logical operations.

OperatorMeaning
ANDReturns true if both conditions are true
ORReturns true if at least one condition is true
NOTReverses the logical value
lau-compiler.exe
varol hasSeeds = true
varol freeSpot = false
if hasSeeds AND freeSpot then
print("Ready to plant!")
end
if hasSeeds OR freeSpot then
print("At least one condition is true!")
end
varol isLocked = true
if NOT isLocked then
print("Unlocked!")
end
OUTPUT:
Ready to plant! At least one condition is true! Unlocked!

In the Lau language, the OR operator works in a very specific way: If the value on its left is null or false, it looks at the value on its right.

If the value on the left is ‘truthy’ (not null or false), it selects it without ever looking at the value on the right. This method is used to assign a Default Value.

lau-compiler.exe
-- 1. Assigning a Default Value
varol enteredName = null
varol name = enteredName OR "Guest"
print(name) -- Output: "Guest" (Because enteredName is null)
-- 2. If Value Exists
varol registeredName = "A1fi_e"
varol user = registeredName OR "Anonymous"
print(user) -- Output: "A1fi_e" (Because it's not null)
-- 3. Using Not
varol active = false
print(NOT active) -- Output: true
OUTPUT:
Guest A1fi_e true

Some scripts may include special file-level comment directives (pragmas) that change runtime behavior. The most commonly encountered one in LAU docs is the --!ndrone pragma.

  • --!ndrone: When present at the top of a script, this directive disables real-world drone control for that script. This is useful for examples and tests where you want to execute code and show printed output without moving the drone.

Example (will print but not move the drone):

lau-compiler.exe
--!ndrone
drone.move(Enum.Direction.South)
print(1 + 1)
OUTPUT:
2