# 0.4 How to read the figures

> Figures show what the program text does not: memory, the order in which each part runs and what the engine records.

Web page: https://pseudolearn.app/en/spec/lectura/figuras

> **In one sentence**
>
> Figures show what the program text does not: memory, the order in which each part runs and what the engine records.

## 0.4.1 How it works

There are two kinds of figures. **Static** ones explain an idea with a single drawing. **Stepped figures** tell a run: below them are "Previous" and "Next" buttons and a text explaining each step.

Stepped figures come with **zones**. Each zone is a panel that grows as you move forward:

- **Memory**: the variables and their value at that moment.
- **Output**: what the program has already written.
- **Trace**: the events the engine recorded, such as "enters statement" or "decision".

**Figure 0.4-1: Example of a stepped figure**

Three stacked instructions joined by arrows: total gets 0, total gets total plus 5, and Write total. Below, a box with the name total and its value. Each step highlights the instruction being run and the value changes from 0 to 5.

A stepped figure. The drawing highlights the part being run; the zones below collect memory, output and trace.

1. Step 1: The engine creates the variable `total` with the value 0.
2. Step 2: It adds 5 and the total becomes 5.
3. Step 3: It writes the total. The output receives the line "5".

This is the program the figure tells:

### Program: Add and write

```pseudolearn
Algorithm Suma
  Define total As Integer <- 0;
  total <- total + 5;
  Write total;
EndAlgorithm
```

**Output**

```text
5
```

*The program finishes normally.*

## 0.4.2 Figure colours

Figures use the same colours as the editor and switch by themselves with the light or dark theme. Solid boxes are values or instructions; dashed boxes are slots or things that do not exist yet. Red marks what fails or does not run; green, what ends well.

**In short**
- Static figures explain an idea; stepped figures tell a run.
- The Memory, Output and Trace zones grow with each step.
- Colours follow the editor and the system theme.

**See also**
- [1.2 The journey of a program: from text to execution](https://pseudolearn.app/en/spec/vision/viaje.md)
- [13.5 Observing execution](https://pseudolearn.app/en/spec/motor/observacion.md)
