PSeInt Para Cada (for-each loop): walk through an array
Walks through an array from start to end; on each round the variable takes the next slot's value, so you don't have to handle positions.
- Group:
- Structures
- Template
Para Cada
Opens the editor with this example loaded. Run it step by step and watch the flowchart.
Worked example
A complete algorithm, ready to copy and run.
Algoritmo Example Dimension notas[3] notas[1] <- 15 notas[2] <- 9 notas[3] <- 18 Para Cada nota De notas Hacer Escribir nota FinParaFinAlgoritmoOutput
Shows every grade in the array, in order.
This is what the console shows when the example runs.
15918
In a flowchart
This is how it appears in a flowchart, with the same shapes Codoritmo draws.
Template
The general form. Replace what's inside < > with your own data.
Para Cada item De <coleccion> Hacer <acciones>FinParaExamples that use it
Programs from the example library where it appears, from the simplest to the most complete.
Shopping List
Adds items to a list that grows until you type FIN.
Advanced
More structures
Codoritmo is an independent, open-source project inspired by PSeInt and compatible with its syntax. It is not affiliated with the PSeInt project. Official PSeInt website.