Structures de contrôle¶
Conditionnelle si¶
Syntaxe basique¶
Avec sinon¶
Avec sinonsi¶
si note >= 16 alors
afficher("Très bien")
sinonsi note >= 12 alors
afficher("Bien")
sinonsi note >= 10 alors
afficher("Passable")
sinon
afficher("Insuffisant")
fin
Expression conditionnelle¶
Boucle tantque¶
Boucle pour¶
Itération sur une collection¶
Avec indice¶
Avec filtre¶
Sélection (sélectionner)¶
Équivalent du switch / match :
fonction classification(n: entier): texte
sélectionner n
cas 0 => "zéro"
cas 1 => "un"
cas 2 => "deux"
pardéfaut => "autre"
fin
fin
Avec motifs¶
Interrompre et continuer¶
interrompre¶
Sort immédiatement de la boucle :
continuer¶
Passe à l'itération suivante :