Skip to content
ExamplesEspañolWorkspace →

Example library

Pseudocode examples for learning to program

Short, explained programs grouped by topic and level. Each one comes with its code, its flowchart, a sample run and a challenge to keep practising.

For students

Read the code, see how it looks as a flowchart and compare it with the sample run. Then open it in Codoritmo, change it and solve the challenge.

For teachers

Every example has its own link to share in class or on your course platform. It opens straight in the editor, with nothing to install.

First steps

Your first algorithms: show messages, read input, keep values in variables and do simple calculations.

View topic (4 examples) →

Decisions

Programs that choose what to do with Si, SiNo and Segun: compare values, combine conditions and handle each case.

View topic (5 examples) →
  • Can I Vote?

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

    Beginner
  • Body Mass Index

    Computes your BMI and classifies it as underweight, normal and so on.

    Intermediate
  • Parking Fee

    Charges every started hour, with a daily maximum.

    Intermediate
  • Leap Year

    Applies the calendar rules to tell whether a year is a leap year.

    Intermediate
  • Coffee Shop Menu

    Pick a drink from the menu and get the total to pay.

    Beginner

Loops

Repeat instructions with Mientras, Repetir and Para: count, add up, validate input and play until you guess.

View topic (6 examples) →
  • Times Table

    Prints the multiplication table for the number you choose.

    Beginner
  • Guess the Number

    Guess a secret number from 1 to 100 in seven tries.

    Intermediate
  • Password Check

    Keeps asking for a password until it has at least 8 characters.

    Beginner
  • Countdown

    A rocket launch countdown that ticks second by second.

    Beginner
  • Sum Until Zero

    Adds up the numbers you type until you enter a 0.

    Beginner
  • Drawing Shapes

    Draws a square and a triangle with asterisks.

    Intermediate

Arrays

Store many values under one name: walk through arrays and matrices, search, add up and find the largest.

View topic (5 examples) →
  • Grade Average

    Stores five grades in an array and finds the average and the highest.

    Beginner
  • Linear Search

    Finds a name in a list, ignoring upper and lower case.

    Intermediate
  • Store Inventory

    Records the stock of each product and flags what to restock.

    Intermediate
  • Weekly Sales

    A table of sales by branch and day, with totals.

    Advanced
  • Shopping List

    Adds items to a list that grows until you type FIN.

    Advanced

Sorting & searching

The classic sorting and searching algorithms, with their complexity: bubble, selection, insertion, merge, quick sort and binary search.

View topic (10 examples) →
  • 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
  • Shell Sort

    Insertion sort between far-apart elements, with a gap that shrinks every pass.

    Advanced
  • Merge Sort

    Splits the array in halves, sorts each one recursively and merges them.

    Advanced
  • Quicksort

    Picks a pivot, splits smaller from larger values and sorts each side recursively.

    Advanced
  • Heap Sort

    Arranges the array as a heap, then takes the largest out again and again.

    Advanced
  • 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

Text

Work with strings: measure, cut, join, reverse and count letters with the text functions.

View topic (5 examples) →
  • Palindromes

    Checks whether a phrase reads the same forwards and backwards.

    Intermediate
  • Count Vowels

    Counts the vowels, spaces and other characters in a text.

    Intermediate
  • Name Initials

    Gets the initials of a full name.

    Beginner
  • Caesar Cipher

    Encrypts a message by shifting each letter of the alphabet.

    Advanced
  • Data Formatting

    Fixes upper and lower case, and converts between text and numbers.

    Intermediate

Subprocesses & functions

Split a program into SubProcesos and Funciones: parameters, return values, pass by reference and recursion.

View topic (5 examples) →

Math

Maths problems solved with algorithms: primes, divisors, greatest common divisor and more.

View topic (8 examples) →
  • Prime Numbers

    Finds every prime number up to a limit.

    Intermediate
  • GCD and LCM

    Computes the greatest common divisor and the least common multiple.

    Intermediate
  • Fibonacci Sequence

    Prints the first terms of the Fibonacci sequence.

    Beginner
  • Quadratic Equation

    Solves ax² + bx + c = 0, with real or complex roots.

    Intermediate
  • Roman Numerals

    Converts a number from 1 to 3999 into Roman numerals.

    Advanced
  • Base Conversion

    Writes a number in binary and hexadecimal.

    Advanced
  • Geometry

    Finds a circle's area and solves a right triangle.

    Intermediate
  • Compound Interest

    Watch your savings grow year by year.

    Intermediate

Projects

Longer programs that combine everything else: games and small complete applications.

View topic (5 examples) →
  • Tic-Tac-Toe

    The classic three-in-a-row game for two players.

    Advanced
  • ATM

    Checks your PIN and lets you check, deposit and withdraw money.

    Advanced
  • Class Grade Book

    Records three grades per student and builds a class report.

    Advanced
  • Hangman

    Guess a secret word letter by letter, with six mistakes allowed.

    Advanced
  • Contact Book

    Add, list and search contacts in a book that grows.

    Advanced