1: include "std"; 2: var i = 1; 3: var j : int; 4: while {i < 10} 5: { 6: j = i + i; 7: print j; print "\n"; 8: ++i; 9: };
You will notice the assignment in the line:
j = i + i;Naturally, variables must be initialised or assigned to before they are used, as in C.
You will also have noticed the 'while' loop, one of the control structures Felix provides: it appears to work the same way as a 'while' loop in C, except that a trailing ; is strangely required, and the condition is given in curly brackets. We'll find out exactly why later, but here is a hint: there is no while statement in Felix!