Minimum symbols: Only limited to + - * / = < > and .
Variables: Simple assignment with =, using lowercase function and variable names.
Control Flow: Supports basic conditional statements and loops (for, while).
Data Structures: Simple and intuitive syntax for lists, sets, maps, stacks, and queues.
Functions: Define functions with function keyword and return values with return.
Error Handling: Use try and catch for error management.
Comments: Use # for adding single-line comments.
Variables are declared and assigned in a single step using =
variable_name = value
Initialize the main data structures as follows:
Array/List: list = list
Set: set = set
Map: map = map
Stack: stack = stack
Queue: queue = queue
Define functions using the function keyword, followed by a lowercase function name and lowercase parameters (no parentheses).
function functionname parameter1 parameter2
# function body
return value
end
Define classes using the class keyword, followed by a lowercase class name.
Attributes are defined with their types directly inside the class.
Supported types include int, float, bool, string, and custom types (e.g., type).
class classname
int attribute1
string attribute2
type atr3
end
Conditionals
Use if, else if, and else for branching logic (no parentheses required for conditions).
if condition
# code if true
else if another
# code if another condition is true
else
# code if all conditions are false
end
Loops
For Loop (Over Collection):
for element in collection
# code
end
For Loop (With Index):
for i = start to end step increment
# code
end
While Loop:
while condition
# code
end
Array/List
Access by index: array.index
Append element: array.append value
Remove by index: array.remove index
Get size: array.size
Set
Add an element: set.add value
Remove an element: set.remove value
Check if contains an element: set.contains value
Get size: set.size
Map
Insert or update key-value: map.put key value
Retrieve by key: map.get key
Remove by key: map.remove key
Check if key exists: map.contains key
Get size: map.size
Stack
Push: stack.push value
Pop: stack.pop
Peek: stack.peek
Check if empty: stack.size == 0
Get size: stack.size
Queue
Enqueue (add to end): queue.enqueue value
Dequeue (remove from front): queue.dequeue
Peek: queue.peek
Check if empty: queue.size == 0
Get size: queue.size
Use # for single-line comments to add explanations or notes within the code.
plaintext
# This is a comment
Use try and catch for error handling. Code that may throw an error is placed inside the try block, and the handling code goes inside the catch block.
plaintext
try
# code that may throw an error
catch
# code to handle the error
end