When we want to execute some code many times, we can always copy-paste those commands. But that is not very efficient or readable, so we have commands like "While".
A While command has two parts:
conditionexpression - checked each time before While executes
body- list of commands executed when
Let's write a program that prints numbers 1 to 5:
xwith value 1
x <= 5
xin While body
x = x + 1in While body
You should see numbers
1,2,3...5 printed in the output panel.
Notice the Assign command:
x = x + 1.
You can use x's previous value (before Assign was executed), when calculating its new value! How cool is that? :)