THE LANGUAGE
Small enough to understand.
MiniScript supports values, arrays, arithmetic, conditions, loops and named functions. It runs in a bounded interpreter with no access to files, websites or browser commands.
Open the syntax guide
let total = 0
let items = [2, 4, 6]
total = total + items[0]
print total
if total > 0 {
print "positive"
}
else {
print "zero"
}
while total < 3 {
total = total + 1
}
fn double(n) {
return n * 2
}
let answer = double(4)
print answer
# A full-line commentClosing braces belong on separate lines. Arrays start at index 0 and cannot be edited in place. Use len(items) for their length. Assign a function call on its own line; nested user calls inside expressions are unsupported. let declares a name once in the current function frame; assignment changes it.
Operators: + − * / % == != < <= > >= && || !. Code uses the ordinary keyboard minus sign -.