Features & Software

PSeInt for Beginners: Write Your First Algorithm Step by Step

First PSeInt algorithm printing a greeting in the editor

If you have just started a programming course and your teacher asked you to "solve it in PSeInt", this guide is for you. We will start from zero: what PSeInt is, why it uses pseudocode, how an algorithm is organised, and how to write, run and fix your first programs. By the end you will have written five small algorithms and you will understand every line of them.

You can follow along in the desktop program (see the Windows installation guide or the Mac and Linux guide) or directly in our PSeInt online editor, which runs in your browser.

What is PSeInt?

PSeInt — short for PSeudo Intérprete, "pseudo-interpreter" — is a free educational tool for learning the fundamentals of programming. It was created by Pablo Novara in Argentina and has become one of the most widely used teaching tools in Spanish-speaking schools and universities.

Instead of a real programming language with strict rules, PSeInt uses pseudocode: instructions written in simple Spanish that read almost like sentences. PSeInt then interprets that pseudocode, which means it can actually run it, show the result, point out mistakes and draw the matching flowchart.

Its main features are:

  • An editor with syntax highlighting, auto-completion and templates for each instruction.
  • An interpreter that executes the algorithm and reports errors with the exact line.
  • Step-by-step execution and a table of variables to see what happens inside.
  • Automatic flowcharts that can also be edited.
  • Export of the algorithm to real languages such as C, C++, Java, JavaScript, PHP or Python.
  • Configurable "profiles" so each course can use stricter or more flexible rules.

Why learn with pseudocode first?

When you learn your first programming language, two difficulties arrive at the same time: thinking the solution (the logic) and writing it correctly (the syntax — semicolons, braces, types, imports). Pseudocode removes most of the second problem so you can concentrate on the first.

Compare printing a message in Java and in PSeInt:

// Java needs a class, a method and exact punctuation:
//   public class Main { public static void main(String[] a) { System.out.println("Hola"); } }

// PSeInt:
Escribir "Hola"

The logical skills you build — breaking a problem into steps, choosing the right condition, designing a loop that ends — transfer directly to every language you learn afterwards.

The structure of an algorithm

An algorithm is a finite, ordered list of steps that solves a problem. In PSeInt every algorithm has the same frame:

Algoritmo NombreDelAlgoritmo
    // aquí van las instrucciones, una por línea
FinAlgoritmo
  • Algoritmo marks the beginning and gives the algorithm a name (no spaces; use CamelCase or underscores).
  • The instructions go in between, one per line. Indenting them is not mandatory, but it makes the program much easier to read.
  • FinAlgoritmo marks the end.
  • Lines starting with // are comments: notes for humans that PSeInt ignores.

Older material uses Proceso and FinProceso instead; both forms are accepted.

Your first algorithm: Hello, world

Algoritmo HolaMundo
    Escribir "¡Hola, mundo!"
FinAlgoritmo

Escribir shows something on the screen. The text between quotation marks is a string (a piece of text) and is printed exactly as written. Run it (F9 in the desktop program, Run in the online editor) and you'll see the message in the console.

Try changing the message, adding a second Escribir line, or deleting one of the quotation marks to see what an error looks like. Reading error messages calmly is one of the most useful skills you can develop.

Variables: storing information

A variable is a named box that stores a value. You put a value in it with the assignment arrow <- and you can read it later by using its name.

Algoritmo Variables
    Definir edad Como Entero
    Definir nombre Como Caracter
    edad <- 17
    nombre <- "Lucía"
    Escribir nombre, " tiene ", edad, " años"
    edad <- edad + 1
    Escribir "El año que viene tendrá ", edad
FinAlgoritmo

Read edad <- edad + 1 as "take the current value of edad, add one, and store the result back in edad". The arrow always goes from the right (the calculation) to the left (the box).

Data types

Definir declares a variable and its type, which tells PSeInt what kind of value it will hold:

TypeHoldsExamples
EnteroWhole numbers0, 42, -7
RealNumbers with decimals3.14, -0.5
CaracterText (also written Texto or Cadena)"Hola", "A"
LogicoTrue or falseVerdadero, Falso

In the flexible profile you may skip Definir and PSeInt will deduce the type from the first value. Many teachers still require declarations, because they make the program clearer and catch mistakes such as storing text in a numeric variable.

Input and output: Leer and Escribir

Programs become interesting when they react to the user. Leer stops the program, waits for the user to type a value and stores it in a variable.

Algoritmo Saludo
    Definir nombre Como Caracter
    Escribir "¿Cómo te llamas?"
    Leer nombre
    Escribir "Encantado de conocerte, ", nombre
FinAlgoritmo

Notice the pattern: first an Escribir that tells the user what to type (a prompt), then the Leer. Without the prompt the user sees a blinking cursor and has no idea what the program expects.

Escribir can print several items separated by commas; they are joined without spaces, so add the spaces inside the strings. To keep the cursor on the same line, use Escribir Sin Saltar.

A complete example: the area of a rectangle

Let's combine everything into a classic first exercise. Before writing code, describe the solution in three parts — this habit will save you hours:

  1. Input: the base and the height.
  2. Process: area = base × height; perimeter = 2 × (base + height).
  3. Output: the area and the perimeter.
Algoritmo Rectangulo
    Definir base, altura, area, perimetro Como Real
    Escribir "Base del rectángulo:"
    Leer base
    Escribir "Altura del rectángulo:"
    Leer altura
    area <- base * altura
    perimetro <- 2 * (base + altura)
    Escribir "Área: ", area
    Escribir "Perímetro: ", perimetro
FinAlgoritmo

Test it with values you can check mentally: base 4 and height 6 must give area 24 and perimeter 20. Testing with known answers is how you gain confidence that an algorithm is correct.

Operators you will use every day

  • Arithmetic: +, -, *, /, ^ (power) and MOD (remainder of a division). 7 MOD 2 is 1, which is how you detect odd numbers.
  • Relational: =, <> (different), <, >, <=, >=. They produce a logical value.
  • Logical: Y (and), O (or), NO (not), for combining conditions.

Multiplication and division happen before addition and subtraction, exactly as in maths, so use parentheses whenever you want a different order: (a + b) / 2 is the average, while a + b / 2 is not.

Making decisions: your first Si

Almost every real problem needs the program to choose between alternatives. That's what Si does:

Algoritmo Aprobado
    Definir nota Como Real
    Escribir "Ingrese su nota:"
    Leer nota
    Si nota >= 6 Entonces
        Escribir "Aprobado"
    SiNo
        Escribir "Reprobado"
    FinSi
FinAlgoritmo

If the condition after Si is true, PSeInt runs the first block; otherwise it runs the block after SiNo. There is a whole guide on conditionals in PSeInt when you are ready for more.

Repeating actions: your first loop

A loop repeats instructions. The Para loop is the easiest to start with because you say exactly how many times to repeat:

Algoritmo Contar
    Definir i Como Entero
    Para i <- 1 Hasta 5 Hacer
        Escribir "Vuelta número ", i
    FinPara
FinAlgoritmo

The variable i takes the values 1, 2, 3, 4 and 5, one per repetition. Loops are covered in depth in our guide to Para, Mientras and Repetir.

Running step by step

When a program does not do what you expect, don't guess — watch it. Both the desktop PSeInt and our online editor can execute an algorithm one instruction at a time. The current line is highlighted and a table shows each variable's value. Run the Contar example step by step and observe how i changes and how execution jumps back to the Para line after each repetition. Five minutes of this will teach you more about loops than an hour of reading.

Common beginner mistakes (and how to fix them)

  • Forgetting to close a block. Every Si needs FinSi, every Para needs FinPara. Good indentation makes missing closers obvious.
  • Using a variable before giving it a value. PSeInt will complain that the variable has no value. Initialise counters and accumulators (suma <- 0) before the loop.
  • Mixing types. Storing "10" (text) in an Entero variable is an error; 10 without quotes is a number.
  • Missing quotation marks. Escribir Hola tries to print a variable called Hola. Text must be in quotes.
  • Reversing the assignment. 5 <- x is meaningless; the variable always goes on the left.

A method for solving any exercise

  1. Read the statement twice and underline the data you receive and the result you must produce.
  2. Solve one example by hand, on paper, writing down every step you take.
  3. Turn those steps into input, process and output.
  4. Write the pseudocode, run it with the example you solved by hand, then with unusual values (zero, negatives, very large numbers).
  5. If something fails, run it step by step and watch the variables.

Understanding error messages

Errors are not failures — they are PSeInt telling you exactly where to look. They come in two kinds:

  • Syntax errors are detected before the program runs: a missing FinSi, a misspelled keyword, an unclosed quotation mark. The message includes the line number. Go to that line, and if it looks correct, check the line just above it.
  • Runtime errors appear while the program runs: dividing by zero, using a variable that has no value, typing text when a number was expected. They depend on the data, so a program can work with some inputs and fail with others — which is why you test with several values.

Solved exercise: temperature converter

Statement: read a temperature in degrees Celsius and show it in Fahrenheit and Kelvin. The formulas are F = C × 9 / 5 + 32 and K = C + 273.15.

Algoritmo ConvertirTemperatura
    Definir c, f, k Como Real
    Escribir "Temperatura en grados Celsius:"
    Leer c
    f <- c * 9 / 5 + 32
    k <- c + 273.15
    Escribir c, " °C = ", f, " °F"
    Escribir c, " °C = ", k, " K"
FinAlgoritmo

Check it with values you know: 0 °C must give 32 °F and 100 °C must give 212 °F. If you get different numbers, the formula was probably typed with wrong parentheses.

Good habits from day one

Name your algorithms and variables so they explain themselves, indent every block, and save each exercise in its own .psc file with a clear name such as tp1-ejercicio3.psc. These small habits make it much easier to review your work before an exam.

Where to go from here

You now know the building blocks every programmer uses. Practise with the solved PSeInt examples, keep the syntax reference handy, and learn to read the flowchart of each algorithm you write.

Frequently asked questions

Is PSeInt a programming language?

Not exactly. It is a tool that interprets pseudocode — a simplified, Spanish-based notation for algorithms. It behaves enough like a language to run your programs, but its goal is learning, not building applications.

Do I need to know Spanish to use PSeInt?

Only a few dozen keywords, such as Leer (read), Escribir (write), Si (if), Mientras (while) and Para (for). Our commands guide translates all of them.

Is PSeInt case-sensitive?

No. Escribir, escribir and ESCRIBIR are the same instruction, and variable names are not case-sensitive either. Still, choose one style and stick to it.

How long does it take to learn PSeInt?

Most students write simple programs with input, output and conditions in their first week, and are comfortable with loops and arrays after a few weeks of regular practice.