Skip to content
EspañolWorkspace →

PSeInt profile UNL FICH

These are the rules of the UNL FICH profile, explained simply, with an example that follows them and opens in Codoritmo with one click.

Open in Codoritmo with this profile

Opens this page's example with the UNL FICH profile already switched on.

How its author describes it

The profile's original text, in Spanish, as distributed with PSeInt.

Esta es la configuración que se utiliza en la asignatura "Fundamentos de Programación" de la carrera "Ingeniería en Informática" de la "Facultad de Ingeniería y Ciencias Hídricas" de la "Universidad Nacional del Litoral".

In short

What changes compared with Codoritmo's default profile:

  • Every variable needs a value before it is used
  • The Para counter is protected
  • Entonces, Hacer and endings such as FinSi must be written in full
  • No conditions like Es Par: comparisons use operators
  • Text can't be joined with +
  • Repetir only ends with Hasta Que
  • Counting down needs Con Paso -1
  • No SubProceso or Funcion of your own
  • No text functions such as Longitud or Subcadena

All of its rules

Marked rules differ from Codoritmo's default profile; everything else behaves the same.

Variables

How they are declared and when they can be used.

Declare variables with Definir
Optional. You can use a variable without declaring it: its type comes from the first value you store in it.
Give a value before useDiffers from default
Required. Reading a variable, or an array slot, that has no value yet stops the program with an error. That's why accumulators start with something like suma <- 0.
Protected Para counterDiffers from default
Inside a Para you can't change the counter, and once the loop ends the counter has no value, so don't use it afterwards.
Accents and ñ in names
Allowed: a variable can be called año or posición.

Writing style

Punctuation, closing words and how values are assigned.

Semicolon at the end
Optional. You can end statements with ; or leave it out.
Relaxed syntaxDiffers from default
Strict: write every structure in full, with Entonces, Hacer and one-word endings such as FinSi and FinMientras.
Assign with =
Not allowed: you assign only with <-; = is only for comparing.

Operators and conditions

How comparisons are written and text is put together.

Word operators
You can write Y, O, NO and MOD (and, or, not, remainder) as well as their symbols &, |, ~ and %.
Plain-language conditionsDiffers from default
Doesn't accept them: write the comparison with operators, such as x MOD 2 = 0 or x > 5.
Join text with +Differs from default
Not allowed: to show several values together, separate them with commas in Escribir.

Arrays

Where indexes start and how the size is set.

First array index
Arrays start at 1: after Dimension notas[3] the slots are notas[1], notas[2] and notas[3].
Array size from a variable
Allowed: you can read n and then write Dimension datos[n].
Resize arrays
You can change the size of an existing array with Redimensionar.

Loops and Segun

Which ways of repeating and choosing between cases it accepts.

Para Cada loop
Available: Para Cada nota de notas Hacer goes through every slot of an array.
Repetir … Mientras QueDiffers from default
A Repetir loop can only end with Hasta Que condition (until).
Para counting downDiffers from default
To count down you must write Con Paso -1; without it, Para i <- 3 Hasta 1 doesn't run at all.
Segun with whole numbers
The value a Segun checks can also be text, with options such as "a".

Subroutines and text functions

Which extra tools you get to organise the program.

Your own subroutines and functionsDiffers from default
Not allowed: the whole program goes inside Algoritmo … FinAlgoritmo.
Text functionsDiffers from default
Not available: this profile has no Longitud, Subcadena, Mayusculas, Minusculas or Concatenar.

An example that follows these rules

It works out the average of three marks. It's written for this profile, and the comments point out what changes compared with the default. We checked it with Codoritmo's interpreter using these same rules.

PerfilUNLFICH.psc · 38 lines
// Example written with the rules of the UNL FICH profile// Strict syntax: Entonces, Hacer and FinSi always in full// This profile has no SubProceso or Funcion: everything goes inside AlgoritmoAlgoritmo PerfilUNLFICH    Dimension notas[3]    notas[1] <- 8    notas[2] <- 9    notas[3] <- 7    // Every variable needs a value before it is used    suma <- 0    Para i <- 1 Hasta 3 Hacer        // Inside the Para you can't change i        suma <- suma + notas[i]    FinPara    promedio <- suma / 3    nombre <- "Ana"    // + doesn't join text: Escribir separates values with commas    Escribir "Hi, ", nombre    Escribir "Average: ", promedio    Si promedio >= 7 Y promedio <= 10 Entonces        Escribir "Passed"    SiNo        Escribir "Failed"    FinSi    // Es Par isn't accepted: the condition uses operators    Si suma MOD 2 = 0 Entonces        Escribir "The sum is even: ", suma    SiNo        Escribir "The sum is odd: ", suma    FinSi    Escribir "Countdown:"    // Counting down needs Con Paso -1    Para i <- 3 Hasta 1 Con Paso -1 Hacer        Escribir i    FinPara    // Longitud, Mayusculas and the other text functions aren't available    // Repetir can only end with Hasta QueFinAlgoritmo

What it prints

This is the example's real output, run with the UNL FICH profile.

Hi, Ana
Average: 8
Passed
The sum is even: 24
Countdown:
3
2
1
Open in Codoritmo with this profile

Examples that touch these rules

They open with the default profile; switch to yours from the editor's bottom bar.

  • Grade Average

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

    Beginner
  • Countdown

    A rocket launch countdown that ticks second by second.

    Beginner
  • Leap Year

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

    Intermediate

Profiles and their descriptions come from the bin/perfiles folder of PSeInt, where each teacher or school contributed their own. Codoritmo ships them unchanged so you can practise with the same rules.

Codoritmo is an independent project inspired by PSeInt and compatible with its syntax; it is not PSeInt and is not affiliated with its authors.