Warning: The interpreter is still in beta and may have bugs. If you need help with code or find a bug, please report it on the Forum Topic.
set <name> to <value>
- Defines a variable.array <value1> <value2> <value3> ... as <name>
- Defines an array or list.replace <index> of <array name> as <new value>
unshift <array name> <value>
- Adds value to the start of an array.push <array name> <value>
- Adds value to the end of an array.reverse <"array" or "text"> <name> as <name>
- Reverses the array or text.out <expression>
- Prints the evaluated expression on a new line.outl <expression>
- Prints the evaluated expression in-line.clear
- Clears the entire output console.delay <seconds>
- Pauses execution for a given number of seconds.add <value1> <value2> as <variable>
subtract <value1> <value2> as <variable>
multiply <value1> <value2> as <variable>
divide <value1> <value2> as <variable>
modulus <value1> <value2> as <variable>
ask <prompt> as <variable>
- Prompts the user for input and stores it in a variable.date <part> as <variable>
- Sets the variable to the current date/time part. Parts can be `year`, `month`, `date`, `hour`, `minute`, `second`, or `timestamp`.random <min> <max> as <variable>
- Generates a random integer between `min` and `max` and stores it in a variable.
Comments are newlines that starting with #
.
while <condition>
<commands>
end
- Repeats the commands as long as the condition is true.
if <condition>
<commands>
end
- Executes the commands if the condition is true.
function <name>
<commands>
end
- Defines a function with the given name.call <name>
- Calls the function with the given name.Conditions use the following syntax: <value> <operator> <value>
Operators include: `=`, `!=`, `<`, and `>`. Conditions can be combined using `and`, e.g., {varname} = 1 and 12 > {myvar}
.
set x to 10 out {x}
set a to 5 set b to 3 add {a} {b} as c out {c}
set counter to 0 while {counter} < 5 add {counter} 1 as counter out {counter} end
set num to 7 if {num} > 5 out "Number is greater than 5" end
date year as currentYear out {currentYear}
array a b c d as alphabet out The 3rd letter of the alphabet is {alphabet:3}!
function greet out "Hello, World!" end call greet
set x to 1 function greet if {x} = 0 out "Hello, World! 1" end if {x} = 1 out "Hello, World! 2" end end call greet set x to 0 call greet
This is text, no need for quotes in between
{variablename}
Hello, {name}!
{length:varname} {length:array}
{letter 0:varname}
{letter varname1:varname2}
{array:0}
{array:varname}