Skip to content
EspañolWorkspace →

Program with blocks and see the pseudocode

In Blocks mode you build your algorithm by dragging coloured pieces, as in Scratch, but each block shows the PSeInt instruction it writes: Escribir, Leer, Si, Para. You learn the logic without fighting the syntax, and when you switch back to code it's already written.

Open this example and switch to Blocks

Opens the program in Codoritmo; press Blocks above the editor.

An algorithm in blocks

A real screenshot of the “Times Table” example in Blocks mode. On the right, the same program's flowchart; below, the pseudocode those blocks produce.

Codoritmo's Blocks mode with the TablaMultiplicar algorithm built from coloured blocks: Definir n, i Como Entero, Escribir, Leer n and a Para loop with an Escribir inside; next to it, its flowchart.

The pseudocode those blocks write

TablaMultiplicar.psc · 8 lines
Algoritmo TablaMultiplicar    Definir n, i Como Entero    Escribir "¿Qué tabla quieres ver?"    Leer n    Para i <- 1 Hasta 10 Hacer        Escribir n, " x ", i, " = ", n * i    FinParaFinAlgoritmo

How to program with blocks in Codoritmo

  1. Switch to Blocks

    Above the editor, the Code / Blocks switch changes the view. If you already had code, it turns into blocks.

  2. Drag from the categories

    Input & output, Variables, Control, Operators, Text & functions, Arrays, and Screen & more. Snap each block under the previous one.

  3. Move one or many

    Dragging a block takes the ones below it along, as in Scratch. To move just one, hold Ctrl (⌘ on a Mac) while you drag it.

  4. Run it and see the code

    Run works just as in the code view. Switch back to Code to see or edit the pseudocode.

Open this example and switch to Blocks

Opens the program in Codoritmo; press Blocks above the editor.

Blocks and code, both ways

You can start in blocks and finish in code, or the other way round. Anything without its own block is kept as a code block holding the exact text, so converting loses nothing but comments.

Code with syntax errors can't be turned into blocks: fix them in the code view and try again.

Codoritmo and PSeInt desktop

PSeInt has no blocks mode, but it offers other writing aids.

What Codoritmo adds

  • A Scratch-like blocks mode, linked to the code both ways.
  • The flowchart updates as you assemble the blocks.

What PSeInt desktop does that Codoritmo doesn't yet

  • Its commands panel inserts a template of each instruction into the code.
  • It works offline, as an installed program.

Codoritmo is an independent project, inspired by PSeInt and compatible with its syntax and school profiles. It is not PSeInt and is not affiliated with it. Official PSeInt website

Frequently asked questions

Is it the same as Scratch?

It works the same way, dragging and snapping, but the blocks are pseudocode instructions rather than animations. The point is to move from blocks to the pseudocode your class asks for.

Do I lose my code if I switch to blocks?

No instruction is lost: anything without its own block stays as a code block. The only thing lost is comments (//).

Are the blocks in Spanish?

The instructions on the blocks use PSeInt's Spanish keywords in every language, so they match the code. The category names follow the page's language.

Solved programs, each with its code, its flowchart and a sample run.

  • Times Table

    Prints the multiplication table for the number you choose.

    Beginner
  • Personal Greeting

    Asks for your name and age, and answers with both.

    Beginner
  • Can I Vote?

    Tells you whether you can vote or how many years you have left.

    Beginner
  • Countdown

    A rocket launch countdown that ticks second by second.

    Beginner

Keep learning