Coding Qubics in QL

Program Architecture

Specification

Every QL program is basically a linear sequence of statements which is processed line-by-line:

a = 1;
i = 0;

while (i < epoch) {
    a = a*2;
    i = i+1;
}

return({'amount': a});

The return(…) Function

The return(…) function completes the execution. The parameter you pass with the call will be published as result for the epoch. So always make sure to let your qubic end with something similar to: return(my_result_var);

Whitespace and Comments

Whitespace (outside of strings) is completely ignored. Comments are started with // and end with the next line-break.

Development

In the future you will be able to define custom functions that you can call from anywhere in your code, so you can create more interesting algorithms. But this feature is not implemented as of now.