Skip to content
EspañolWorkspace →

PSeInt SubAlgoritmo: another name for SubProceso

Another name for SubProceso: groups instructions under a name to reuse them. It works exactly the same.

Template
SubAlgoritmo
Open it in Codoritmo

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.

subalgoritmo.psc · 8 lines
SubAlgoritmo Linea()    Escribir "----------"FinSubAlgoritmoAlgoritmo Example    Linea()    Linea()FinAlgoritmo

Output

Every call to Linea() draws a line.

This is what the console shows when the example runs.

--------------------

In a flowchart

This is how it appears in a flowchart, with the same shapes Codoritmo draws.

Linea()
In the flowchart. Flowchart: a subprocess call rectangle reading "Linea()", with one arrow in and one arrow out.
Draw the flowchart of your own algorithm →

Template

The general form. Replace what's inside < > with your own data.

SubAlgoritmo · 3 lines
SubAlgoritmo Nombre(<parametro>)  <acciones>FinSubAlgoritmo

Examples that use it

Programs from the example library where it appears, from the simplest to the most complete.

  • Bubble Sort

    Sorts random numbers by swapping neighbors, and stops as soon as they're in order.

    Intermediate
  • Selection Sort

    Finds the smallest of the remaining numbers and puts it in its place.

    Intermediate
  • Insertion Sort

    Inserts each number among the sorted ones, like arranging cards in your hand.

    Intermediate
  • Counting Sort

    Counts how many times each value appears, without comparing numbers.

    Intermediate
  • Binary Search

    Finds a value in a sorted array by halving the range every step.

    Intermediate
  • Linear vs. Binary Search

    Counts the comparisons each search needs on the same sorted list.

    Intermediate
See every SubProcesos example →

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.