anScript

Syntax

Each line contain at most one instruction. Instruction consists of its name and round brackets. Instruction’s arguments should be between round brackets and splitted with commas.

Example:

instruction1()
instruction2(a)
instruction3(b,c,d)

There is also possible that first argument is passed as below (dot syntax, it’s equivalent to thease above).

Dot syntax example:

a.instruction2()
b.instruction3(c,d)

Most instructions’ parameters are variables. There are few exceptions, though. Parameters could be also instructions, math expressions and paths.

Instruction passed to instruction:

variableCreate(n,11.i)
logicLoopI(n,basicSubstraction,n,n,1.i)
    consolePrint(n,_.s)
}
/Output is: 10_9_8_7_6_5_4_3_2_1_

Math expression passed to instruction:

variableAssign(n,7.i)
instructionCreate(printResult,x,exp)
    x=exp
    consolePrint(x)
}
printResult(n,x+30.i)
/Output is: 37

Arguments can be passed by reference (default) or value.

Passing arguments by reference:

instructionCreate(ins,a)
    variableAssign(a,3.14.f)
}
variableCreate(b,70.i)
/Now b has value 70.i
ins(b)
/Now b has value 3.14

Passing arguments by value:

instructionCreate(ins,a)
    variableAssign(a,3.14.f)
}
variableCreate(b,70.i)
/Now b has value 70.i
ins(*b)
/Now b has value 70.i

Elements in variable array could be accessed with specific instuctions (see instruction reference) or with square brackets.

[] operator:

Access element in array

var[] array[var.i iterator]
a[b]=c
instruction4(d[e][f])
g[h[i]].instruction5()

Reference to variable named as key’s value

[var.s key]
variableCreate(a, var.s)

consoleScan([a.s])
/Like consoleScan(a)

[a.s].consolePrint()
/Like a.consolePrint()

Comment:

Lines with comments start with /.

/Happy coding!

Inline whitespaces will be omitted.