0.3.1 How it works
Every language construct is first shown with its form. Coloured words are written exactly as shown. Slots «like this» are replaced by code. Whatever goes between ⟦ and ⟧ is optional: you may write it or not.
While «condition» Do
«statements»
EndWhileAt the top, the If form: the word If and the word Then are fixed, and between them there is a dashed slot called condition. An arrow goes down from the slot to the filled line If n > 0 Then. At the bottom, Else appears between double brackets: it is an optional part that can be left out.
When a form has parts that repeat or are optional, it comes with an anatomy: a real line of code split into pieces, with the name of each one underneath.
Whileword that opens the loopn <= 3condition: checked before every roundDoword that ends the line
This program fills the While form with a condition and a statement:
ProgramFilling in the form
Algorithm Cuenta
Define n As Integer <- 1;
While n <= 3 Do
Write n;
n <- n + 1;
EndWhile
EndAlgorithmOutput
1 2 3
The program finishes normally.
In short
- Coloured words: written as they are.
- Slots «like this»: you fill them in.
- ⟦…⟧: optional part.
- An anatomy splits a real example and names each piece.