01 · Overview
About PSeInt
PSeInt is an educational environment for writing and running algorithms in pseudocode. Its official reference describes Spanish-language instructions and profiles with more flexible or stricter rules.
The environment can also display algorithms as flowcharts, making sequences, decisions, and loops easier to follow alongside the instructions.
02 · Organization
Algorithm structure
The documented format places instructions between Proceso and FinProceso. Some versions and profiles also accept Algoritmo and FinAlgoritmo. Depending on the profile, statements may require semicolons or be separated by lines.
Proceso Saludo
Definir nombre Como Caracter
Escribir "¿Cómo te llamas?"
Leer nombre
Escribir "Hola, ", nombre
FinProceso03 · Data
Variables, types, and assignment
An explicit declaration uses Definir nombre Como Tipo. Assignment evaluates the right-hand expression and stores its result in the variable on the left; the types must be compatible.
| Type | Use |
|---|---|
Entero | Integer numbers. |
Real | Numbers with a decimal part. |
Caracter | Characters and text. |
Logico | Verdadero or Falso. |
Definir edad Como Entero
Definir promedio Como Real
Definir nombre Como Caracter
Definir aprobado Como Logico
edad <- 16
promedio <- 8.25
nombre <- "Ana"
aprobado <- VerdaderoNames start with a letter, may continue with letters and digits, and cannot match reserved words. Comments start with //.
04 · Expressions
Operators and functions
| Category | Forms | Meaning |
|---|---|---|
| Arithmetic | + - * / ^ % MOD | Arithmetic, exponentiation, and integer remainder. |
| Relational | > < = <= >= | Comparisons. |
| Logical | & Y | O ~ NO | Conjunction, disjunction, and negation. |
Parentheses change the usual evaluation order. The reference also lists built-in functions such as RC, ABS, LN, EXP, SEN, COS, ATAN, TRUNC, REDON, and AZAR.
area <- base * altura / 2
resto <- numero MOD 2
es_par <- resto = 0
raiz <- RC(numero)
05 · Interaction
Input and output
Leer receives one or more values and assigns them to the listed variables. Escribir displays one or more expressions. Some profiles include output without a line break, such as Escribir Sin Saltar.
Escribir "Enter two numbers:"
Leer a, b
suma <- a + b
Escribir "Sum: ", suma06 · Decisions
Conditions and selection
Si evaluates a condition; Entonces introduces the true branch and Sino the alternative. Segun selects among several cases and may include De Otro Modo.
Si nota >= 7 Entonces
Escribir "Aprobado"
Sino
Escribir "Keep practicing"
FinSi
Segun opcion Hacer
1:
Escribir "Start"
De Otro Modo:
Escribir "Invalid option"
FinSegun07 · Repetition
Loops
Mientras checks its condition before each iteration. Repetir runs the body first and checks Hasta Que, so it executes at least once. Para walks a range and can use Con Paso.
Para i <- 1 Hasta 5 Con Paso 1 Hacer
Escribir i
FinPara
Repetir
Leer clave
Hasta Que clave = "fin"Make sure the stopping condition can become true to avoid an infinite loop.
08 · Collections
Arrays and matrices
Dimension declares an array or matrix. Its notation and starting index depend on the active profile, so do not assume the bounds. This example has five positions numbered from 0 through 4:
Definir notas Como Real
Dimension notas[5]
Para i <- 0 Hasta 4 Hacer
Leer notas[i]
FinPara
Escribir "First grade: ", notas[0]A second dimension creates a matrix and requires one index per dimension. Check the size and bounds set by the profile before accessing a position. Arrays can also be passed to subprograms when their signature is supported by the profile.
09 · Reuse
Subprograms
SubProceso defines a reusable routine. If it returns a value, the header names the variable that receives the result; otherwise, it performs actions without returning one. Call it by name with arguments in parentheses. Parameters can be inputs or, when the profile supports the form, passed by reference to return changes to the caller.
SubProceso resultado <- Doble(numero)
resultado <- numero * 2
FinSubProceso
Proceso Principal
Escribir Doble(6)
FinProcesoLocal variables stay within the routine. The reference includes recursive calls, such as a power calculation, and passing arrays as arguments. Prefer value parameters for calculations that should not change the original variable; use references only when a routine truly needs to return a modification.
10 · Combined example
Average and result
Proceso Promedio
Definir a, b, c, media Como Real
Escribir "Enter three grades:"
Leer a, b, c
media <- (a + b + c) / 3
Si media >= 7 Entonces
Escribir "Approved: ", media
Sino
Escribir "Keep practicing: ", media
FinSi
FinProceso11 · Math library
Built-in functions
The functions below appear in PSeInt's basic reference. Write arguments in parentheses; assign, display, or combine the returned value in another expression.
| Form | Result |
|---|---|
RC(x) | Square root. |
ABS(x) | Absolute value. |
LN(x), EXP(x) | Natural logarithm and exponential function. |
SEN(x), COS(x), ATAN(x) | Trigonometric functions. |
TRUNC(x), REDON(x) | Integer part and nearest integer. |
AZAR(n) | Random integer from 0 through n - 1. |
Longitud(texto) | Number of characters. |
SubCadena(texto, inicio, fin) | Substring between the specified positions. |
Concatenar(a, b) | Joins two character strings. |
Mayusculas(texto), Minusculas(texto) | Converts letters to uppercase or lowercase. |
Definir radio, area Como Real
radio <- 3
area <- 3.14159 * radio ^ 2
Escribir "Area: ", REDON(area)
Escribir "Die: ", AZAR(6) + 1
Definir frase, minuscula Como Caracter
frase <- "Hola, mundo!"
minuscula <- Minusculas(frase)
Escribir "Characters: ", Longitud(minuscula)
Escribir "Start: ", SubCadena(minuscula, 1, 3)
Escribir Concatenar("Text: ", minuscula)
Check the domain of each math function. String operations depend on the profile that enables them. This example starts indexes at 1, so adjust SubCadena to match the active profile.
12 · Writing variants
PSeInt configuration profiles
The selected profile groups the writing options accepted by PSeInt. The official documentation presents Estricto and Flexible as examples of these differences; the program also offers predefined profiles for institutions. The examples illustrate configurations, not a universal list of rules for every class.
| Aspect | Estricto | Flexible |
|---|---|---|
| Structure | Proceso / FinProceso. | Algoritmo / FinAlgoritmo. |
| Data declarations | Declares variables with Definir and their types. | Can infer types from how variables are used. |
| Statement separators | The examples use semicolons. | The examples separate statements by line. |
| Collection traversal | Para I <- ... accesses each position by index. | Para Cada Elemento de Lista traverses the elements. |
| Conditions | Uses comparisons such as Elemento > ValMayor. | Also accepts descriptive forms such as Es Mayor Que and Es Par. |
| Array dimensions | The example reserves Dimension Lista[100]. | The example uses Dimension Lista[Cant]. |
Option names, array limits, and other constructs depend on the profile actually selected. For class exercises, follow the profile specified by the teacher or course material.
Institutional profiles
PSeInt can provide profiles prepared for universities, faculties, and degree programs. They package the options chosen for a course in one file; availability depends on the list included with the distribution or supplied by the institution.
Create, save, and load a profile
- Open Configurar (“Configure”) → Opciones del Lenguaje (perfiles) (“Language Options (profiles)”).
- In the profile selection window, choose Personalizar (“Customize”).
- Adjust the options to match the conventions the class needs to use.
- Use the button with the floppy-disk icon to save the profile to a file; choose where to store it, add a description, and give the file a name that identifies the profile.
- To use a shared profile, reopen profile selection, choose Cargar (“Load”), and select the file you received.
After loading it, confirm that the profile is selected before writing or running an algorithm. Sharing the same file helps keep examples in a class under the same rules.
13 · Problem solving
Testing and tracing
Before running an algorithm, identify its inputs, expected result, and conditions that can change its path. Then try simple values whose results you can calculate independently.
- Test a normal case and boundary values such as zero, one item, and the largest expected input.
- At each loop, watch the condition, counter, and variables that change.
- For arrays, verify every index falls inside the declared dimension.
- For a function, compare its arguments with the returned value and inspect each return path.
The interpreter can trace execution step by step and compare it with a flowchart. A trace helps locate the moment a variable stops matching the expected value; it does not replace choosing useful test cases.
14 · Further reading
References
- Official PSeInt site.
- Web pseudocode reference, with structure, operators, functions, and lexical rules; the site marks it as outdated and recommends the integrated help for current versions.
- Official examples with pseudocode and flowcharts.
- Official string operations example; this feature must be enabled in the selected profile.
- The official profile guide explains how to customize, save, and share settings.
- The official features page says the pseudocode is configurable and that predefined institutional profiles are available.
- The official documentation recommends the integrated help for detailed rules in the installed version.