Download Avocado
Download Avocado for Windows Download
Avocado installation
The new version of Avocado v 1.0.1.0 includes the FPC compiler. Simply unzip the latest version of Avocado with the .7z extension and you can start writing code.
Old versions of Avocado
You can download the FPC compiler from SourceForge. SourceForge or on the official website FPC
In the IDE settings on the Windows platform, add the path to the fpc.exe compiler, e.g.
C:\Users\Programista Art\Downloads\fpc\3.2.2\bin\x86_64-win64\fpc.exe
In the IDE settings on the Windows platform, add the path W ‘Link to FPC folder’, e.g.:
C:\Users\Programista Art\Downloads\fpc\3.2.2\
Integer Types (9)🔢
| Polish name | English name | Description |
|---|---|---|
liczba_całkowita or lc |
int |
A signed integer with a platform-dependent size (typically 4 bytes, e.g., -2147483648 to 2147483647) – the recommended default type. |
liczba_mała |
int16 |
A signed integer with a size of 2 bytes (-32,768 to 32,767). |
liczba_długa |
int32 |
A signed integer with a size of 4 bytes (-2147483648 to 2147483647). |
liczba_krótka |
int8 |
Signed integer with a size of 1 byte (-128 to 127) |
liczba64 |
int64 |
8-byte signed integer (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807). |
bajt |
byte |
An unsigned integer of size 1 byte (0 to 255). |
liczba16 |
uint16 |
Unsigned integer with a size of 2 bytes (0 to 65,535) – positive, 16-bit number. |
liczba32 |
uint32 |
Unsigned integer with a size of 4 bytes (0 to 4,294,967,295) – positive number, 32-bit. |
qliczba |
qword |
Is unsigned, you can store large binary values, addresses, bit masks, IDs, timestamps, etc. you need large integers (larger than LongWord), numbers cannot be negative, you want to operate on addresses, pointers or raw memory data, you implement something low-level (e.g. VM, JIT, CPU cycle counting system, etc.). |
Real Types (Floating Point - Real) (6) 📊
| Polish name | English name | Description |
|---|---|---|
liczba_zm or lzm |
real |
A floating-point type with a size dependent on the implementation (usually equivalent to Double) – not recommended for new projects. |
liczba_pojedyncza |
ubyte |
Single precision floating point number (4 bytes). |
liczba_podwójna |
float |
Double-precision floating-point number (8 bytes) – recommended default type. |
liczba_rozszerzona |
float80 |
Extended precision floating point number (10 bytes). |
liczba_zgodna_delphi |
comp |
An 8-byte integer stored as a floating point number (for compatibility with Delphi). |
liczba_waluta |
decimal |
Data type for financial operations, with fixed precision (8 bytes). |
Boolean Types ✅
| Polish name | English name | Description |
|---|---|---|
logiczny |
bool |
Accepts values true or false (usually 1 byte). |
logiczny_bajt |
byte_bool |
Number – 0 means false, any other value means true (1 byte). |
logiczne_słowo |
-- |
Similar to byte_bool, but with a size of 2 bytes. |
logiczny_długi |
long_bool |
PSimilar to byte_bool, but with a size of 4 bytes. |
Typy Znakowe (Char) (2)
| Polish name | English name | Description |
|---|---|---|
znak |
char |
A single character (usually 1 byte, representing an ASCII character). |
znak_unicode |
char32 |
Single Unicode character (usually) 2 lub 4 bajty, zależnie od implementacji). |
String Types (6)
| Polish name | English name | Description |
|---|---|---|
tekst |
string |
A string of characters with a dynamic length – a so-called long string. |
tekst255 |
string255 |
A string with a static length (max. 255 characters), with the first byte storing the length. |
tekst_ansi |
ansi_string |
Alias forstring |
tekst_unicode |
unicode_string |
A dynamic-length Unicode string, recommended for handling characters outside the standard set. |
tekst_systemowy |
wide_string |
A Unicode string, similar to UnicodeString, but managed by the system. |
lista_tekstów |
string_list |
A Unicode string, similar to UnicodeString, but managed by the system. |
Array Types (3)
| Polish name | English name | Description |
|---|---|---|
tablicaLiczb nazwa = [1,2,3,4] |
-- |
Fixed-size numeric array. |
tablicaTekstów nazwa = [’a’,’b’,’c’] |
-- |
Fixed-size text box |
ustaw_długość(tablica, 10) |
set_length(tablica, 10) |
Setting the size of the text board and number board |
Collective Types (Set) (1)
| Polish name | English name | Description |
|---|---|---|
kolekcja |
set |
A collection of unique elements of a specific type (the base type must be simple, e.g. Character or enumeration type). |
File Types (4)
| Polish name | English name | Description |
|---|---|---|
plik |
file |
General file type. |
plik_tekstowy |
text_file |
Text file. |
plik_binarny |
binary_file |
Binary file. |
plik_struktur |
file_struct |
A file containing records of a specific type. |
Pointer Types (2)
| Polish name | English name | Description |
|---|---|---|
wskaźnik |
pointer |
A general pointer type that stores a memory address. |
wskaźnik_na |
pointer_to |
A pointer to a variable of a specific type. |
Variant Types (2)
| Polish name | English name | Description |
|---|---|---|
wariant |
any |
A variable that can store different types of data – use with caution (lack of type checking may lead to errors). |
oleVariant |
ole_variant |
Variant compatible with OLE (Object Linking and Embedding) technology. |
Conversions (46)
| Previous Polish name | Polish name new since V 1.0.1.0 | English name | Description |
|---|---|---|---|
TekstWLiczbac() |
tekst_na_liczbę() |
str_int() |
Converts text to an integer. |
BajtWTekst() |
bajt_na_logiczny() |
byte_bool() |
projection |
TekstWLiczbar() |
tekst_na_zmiennoprzecinkową() |
str_float() |
Converts text to a floating-point number. |
LiczbacWTekst() |
liczba_na_tekst() |
int_str |
Converts an integer to text. |
LiczbarWTekst() |
zmiennoprzecinkowa_na_tekst() |
float_str() |
Converts a floating point number to text. |
LiczbacWr() |
rzeczywista() |
real() |
Converts an integer to a floating-point number. |
LiczbarWc() |
obetnij() |
trunc() |
Converts a floating point number to an integer. |
LogicznyWTekst() |
logiczny_na_tekst() |
bool_str() |
Converts a logical value to text. |
TekstLD(tekst,wartość_domyślna) |
tekst_na_liczbę_lub_domyślną(tekst,wartość_domyślna) |
str_int_def(tekst,wartość_domyślna) |
Converts a string to an integer. If the conversion fails, it returns default_value. |
Zaokrąglij(liczba_zmiennoprzecinkowa) |
zaokrąglij(liczba_zmiennoprzecinkowa) |
round(liczba_zmiennoprzecinkowa) |
Rounds a floating-point number to the nearest integer. |
Słowo(większa_liczba_całkowita) |
na_całkowitą_16(większa_liczba_całkowita) |
word(większa_liczba_całkowita)) |
Projection |
Liczba_dc(większa_liczba_całkowita) |
liczba_całkowita_32(większa_liczba_całkowita) |
long_int(większa_liczba_całkowita) |
Projection |
Kard(liczba_całkowita) |
liczebnik(liczba_całkowita) |
cardinal(int) |
Projection. Ensures conversion to a non-signed type. |
FormatLiczby(liczba_zmiennoprzecinkowa, format, precyzja, cyfry) |
zmiennoprzecinkowa_na_tekst_formatowany |
float_strf(liczba_zmiennoprzecinkowa, format, precyzja, cyfry) |
Converts a floating-point number to a string with controlled formatting. format is one of ffGeneral, ffExponent, ffFixed, ffNumber, ffCurrency. precision and digits control the number of digits. |
TekstWLiczbar() |
tekst_na_zmiennoprzecinkową() |
str_float() |
Converts a string to a floating point number. |
LiczbarWR(Liczba_rozszerzona) |
podwójna_precyzja() |
double(float80) |
Conversion between floating point types. |
Liczba_pojedynczaWZm(liczba_podwójna/Liczba_rozszerzona) |
Liczba_pojedyncza_na_zm(liczba_podwójna/Liczba_rozszerzona) |
single(float80) |
Projection |
Liczba_rozszerzonaWPojedynczą(Liczba_pojedyncza/liczba_podwójna) |
liczba_rozszerzona_na_pojedyńczą(Liczba_pojedyncza/liczba_podwójna) |
extended(ubyte/float) |
Projection |
ZnakwASCII(kod_ASCII) |
liczba_na_znak(kod_ASCII) |
chr(kod_ASCI) |
Converts ASCII code (integer) to a character. |
ord(znak) |
znak_na_liczbę(znak) |
ord(char) |
Converts a character to its ASCII code (integer). |
TekstWZnak(Znak) |
tekst_na_znak(znak) |
string(char) |
Creates a single-character text from the given character. |
ZnakWTekst(tekst[indeks]) |
znak_na_tekst(tekst[indeks]) |
char(string[index]) |
Retrieves a character from the text at a given position (indexing starts at 1). This is not a conversion, but a commonly used method of accessing a single character in a text. |
LogicznyWTekst(logiczny, użyj wartości prawda lub falsz) |
logiczny_na_tekst(logiczny, użyj wartości prawda lub falsz) |
bool_str(bool, użyj wartości true lub false) |
Converts a logical value (Boolean) to Text. If you use the values True or False, it uses true and false; if False (default), uses ‘1’ and ‘0’. |
TekstWLogiczny(tekst) |
tekst_na_logiczny(tekst) |
str_bool(string) |
Converts a string (‘true’, ‘false’, ‘1’, ‘0’) to a logical value. Case does not matter for “true” and ‘false’. Returns an error if the text is invalid. |
TekstWLogicznyDom(tekst, wartość domyślna) |
tekst_na_logiczny_dom(tekst, wartość domyślna) |
str_bool_def(string, wartość domyślna) |
Converts a string to a logical value. If the conversion fails, it returns the default value. |
LogicznyZliczby(liczba): |
logiczny_z_liczby(liczba) |
bool(liczba) |
Projection. 0 is converted to False, any other value to True. |
LiczbacZLogicznego(Logiczny) |
liczba_całkowita_z_logicznego(Logiczny) |
int(bool) |
Projection. true is converted to 1, false to 0. |
LiczbacZWyliczenia(wartość wyliczeniowa) |
liczba_całkowita_z_wyliczenia(wartość wyliczeniowa) |
ord(wartość wyliczeniowa) |
Returns the ordinal number of the calculated value (integer). |
ZwróćNazwęTekst(TypWyliczeniowy, Liczba(wartość wyliczeniowa)) |
pobierz_nazwę_tekstu(TypWyliczeniowy, Liczba(wartość wyliczeniowa)) |
get_enum_name(TypWyliczeniowy, Liczba(wartość wyliczeniowa)) |
Returns the name of the enumeration value as a string. Requires the TypInfo module. |
ZwróćLiczbac(TypWyliczeniowy, Nazwa Wartości): |
pobierz_wartość_wyliczenia(TypWyliczeniowy, Nazwa Wartości) |
get_enum_value(TypWyliczeniowy, Nazwa Wartości) |
Returns a calculated value (as an integer) based on a name (text). Requires the TypeInfo module. |
DataWTekst(data) |
data_na_tekst(data) |
date_str(data) |
Converts the date to text in the default format. |
CzasWTekst(czas) |
czas_na_tekst(czas) |
time_str(czas) |
Converts time to text in the default format. |
DataCzasWTekst(data i czas) |
data_czas_na_tekst(data i czas) |
date_time_str(data i czas) |
Converts the date and time to text in the default format. |
DataCzasWTekstF(format, data i czas) |
formatuj_data_czas_na_tekst(format, data i czas) |
format_date_time(format, data i czas) |
Converts a date and time to text using the specified format. format is a string that contains formatting specifiers (e.g., ‘yyyy-mm-dd hh:nn:ss’). |
TekstWCzas(tekst) |
tekst_na_czas(tekst) |
str_to_time(string) |
Converts text into time. |
TekstWCzasDom(tekst) |
tekst_na_czas_dom(tekst) |
str_time_def(string) |
Converts a string (text) into a time value. |
TekstWDatęCzasDom(tekst) |
tekst_na_datę_czas_dom(tekst) |
str_datetime_def(string) |
Converts a string into a date and time value, and if the conversion fails, returns a default value defined by the programmer. |
TekstWDatęCzas(tekst) |
tekst_na_datę(tekst) |
str_date(string)/code> |
Converts text to date and time. |
TekstWDatęDom(tekst, wartość domyślna) |
tekst_na_datę_dom(tekst, wartość domyślna) |
str_date_def(string, wartość domyślna) |
Converts a string to a date. If the conversion fails, it returns a default value. |
DataCzasZ(rok, miesiąc, dzień) |
utwórz_datę(rok, miesiąc, dzień) |
encode_date(rok, miesiąc, dzień) |
Creates a value from the specified date components. |
CzasZ(godzina, minuta, sekunda, milisekunda) |
utwórz_czas(godzina, minuta, sekunda, milisekunda) |
encode_time(godzina, minuta, sekunda, milisekunda) |
Creates a value from the given time components. |
RozłóżDatę(data, rok, miesiąc, dzień) |
rozłóż_datę(data, rok, miesiąc, dzień) |
decode_date(data, rok, miesiąc, dzień) |
Breaks down the value into year, month and day. |
RozłóżCzas(czas, godzina, minuta, sekunda, milisekunda) |
rozłóż_czas(czas, godzina, minuta, sekunda, milisekunda) |
decode_time(czas, godzina, minuta, sekunda, milisekunda) |
Breaks down the value into hours, minutes, seconds, and milliseconds. |
NiebezpiecznyWskaźnikZAdresu(liczba całkowita) |
adres_zmiennej(liczba całkowita) |
ptr |
Converts an integer to a pointer. Very dangerous – only use this if you are absolutely sure what you are doing. Typically used for interacting with low-level code or APIs. |
@zmienna |
@zmienna |
@zmienna |
Address retrieval operator. Returns a pointer to a variable. This is not a conversion, but it is crucial for working with pointers. |
NiebezpiecznyAdresZWskaźnika |
adres_zmiennej_z_wskażnika |
int_ptr |
Address retrieval operator. Returns a pointer to a variable. This is not a conversion, but it is crucial for working with pointers. |
Reading and songs in the console (5)
| Polish name | English name | Description |
|---|---|---|
pisz() |
print() |
Writes data to the console output without adding a new line character. Example: print(“Hello World”).. |
pisz_linie() |
print_line() |
Prints data to the console output and adds a new line character after printing. Multiple values can be printed. Example: print_line(“Value a: ”, a, “, value b: ”, b). |
piszf() |
-- |
Allows you to format the output using format specifiers. E.g. piszf('Number: %d, floating point: %.2f', [number, floating point]). Example: piszf('Name: %s, Age: %d years, Height: %.2f', [Name, Age, Height]) |
czytaj('') |
-- |
User data entry, reads until a white character is encountered (space, tab, enter) function read('Enter your name') |
czytaj_linie('') |
-- |
User input reads the entire line (up to the end-of-line character). Multiple variables can be read simultaneously, e.g. czytaj_linie(a, b, c) example czytaj_linie('Enter your name') |
Format specifiers (4)
Format specifiers are special sequences placed in a string that inform the formatting function pisf about how to convert and display the given arguments. They allow you to control how numbers, strings, and other data types are converted to text.
| Polish name | English name | Description |
|---|---|---|
%d |
%d |
Format for integers (decimal). Example: piszf('Age: %d years', [age]). |
%f |
%f |
Format for floating point numbers. Example: piszf('Height: %f', [Height]) |
%.2f |
%.2f |
Format for floating point numbers with two decimal places. Example: piszf('Height: %.2f', [Height]) |
%s |
%s |
Format for character strings. Example: piszf(;Name: %s;, [First name]) |
Arithmetic operations on numbers (4)
| Name | Description |
|---|---|
+ |
Adding a+b. |
- |
Subtraction a-b |
* |
Multiplication a*b |
/ |
Division a/b |
Comparative operations (7)
| Sign | Description |
|---|---|
= |
Equal, checks whether two values are equal. a=b. |
<> |
Different, not equal Checks whether two values are different. This is the opposite of =, a<>b |
> |
Greater than checks whether the value on the left is greater than the value on the right. a>b |
< |
Less than checks whether the value on the left is less than the value on the right. a |
>= |
Greater than or equal to checks whether the value on the left is greater than or equal to the value on the right. a>=b |
<= |
Less than or equal to checks whether the value on the left is less than or equal to the value on the right. a<=b |
=, <>, >, <, >=, <= |
Text comparison |
Text operations (17)
| Polish name | English name | Description |
|---|---|---|
+ |
Concatenation – the operation of joining two or more strings of characters or texts into one longer string. | |
czytaj_klawisz |
read_key |
Reads a single character from the keyboard without echo (does not display on the screen). Useful for user interaction (e.g., ‘Press any key to continue’).".
Example. znak a = czytaj_klawisz pisz('Wybrany klawisz: ', a) |
klawisz_wciśnięty |
-- |
Checks whether a key has been pressed.
Example. program przycisknacisniety jeśli klawisz_wciśnięty wtedy pisz('Przycisk nacisniety') inaczej pisz('zaden przycisk nie nacisniety') |
długość(s) |
-- |
Returns the length of the text s.
Example. program dlugosctekstu tekst a = 'siema' liczba_całkowita i = 0 i = długość(a) pisznl('Tekst zawiera: ', LiczbacWTekst(i), ' znaków') |
kopiuj(źródło, początek, długość) |
-- |
Returns a fragment of the source text, starting from the start position (counting from 1) and taking the specified number of characters. Parameters
source – input string
start – index of the first character (1 = start of the string)
length – number of characters to copy
Example Program kopiowanie tekst a = 'Ala' pisz_linie(a) tekst b = kopiuj(a, 1, 2); pisz_linie(b); // Al Przykład 2 Program kopiowanie tekst a = 'Ala'; tekst b = kopiuj(a, 1, 1); pisz_linie(b); // A |
wstaw(tekst, zmienna, indeks) |
-- |
Inserts the specified text into a specific location in the variable.
Przykład program alamakota tekst a = 'Ala ma kota' wstaw(' czarnego', a, 7) pisz_linie(a) // Result: Ala ma czarnego kota |
usuń(zmienna, indeks, ilość_znaków) |
-- |
Removes a specified number of characters from the given position.
Example program usuwanie tekst a = 'Ala ma kota' usuń(a, 1, 3) pisz_linie(a) // Result: ma kota |
duże_litery(s) |
-- |
Converts all letters in the text to uppercase s - text variable.
Example program duzelitery tekst a = 'siemka' a = duże_litery(a) pisz_linie(a) // Result: SIEMKA |
małe_litery(s) |
-- |
Converts all letters in the text to lowercase. s - text variable.
Example program malelitery tekst a = 'SIEMA' a = małe_litery(a) pisz_linie(a) // Result: siema |
przytnij(s) |
-- |
Removes spaces from the beginning and end of the text.
Example program przycietytekst string a = ' siema ' a = przytnij(a) print_line(a) // Result: siema |
przytnij_z_prawa(s) |
-- |
Removes spaces only from the end of the text.
Example program przycietytekst string b = ' Programista Art ' string c = 'Wita' string suma = przytnij_z_prawa(b) + c print_line(suma) // Result: Programista ArtWita |
przytnij_z_lewa(s) |
-- |
Removes spaces only from the beginning of the text.
Example program przycietytekst string b = ' Programista Art' string c = c = przytnij_z_lewa(b) print_line(b) print_line(c) // Result: Programista Art |
powtórz_znak(znak, ilość) |
-- |
Creates text from a repeating character.
Example program powtorzenie char a = 'b' int ile = 10 print_line(powtórz_znak(a, ile)) // Result: bbbbbbbbbb |
porównaj_tekst(s1, s2) |
-- |
Compares two strings (case-sensitive) by looking at their contents from left to right. The comparison ends when the first difference is encountered. The result of the comparison is then based on the difference in the ASCII or Unicode values of those specific characters.
Returns 0 if they are equal <0, jeśli s1 < s2 0, jeśli s1 > s2 Example program porownajtekst string a = 'Siema' string b = 'Programista' print_line(porównaj_tekst(a, b)) // Result: 3 means that the first string ('siema') is "bigger" than the second one ('Programista'). |
szukaj(szukany, tekst) |
-- |
Returns the position of the first occurrence of the character "search" in the string "text." If not found, returns 0.
Parameters
search – the character or word we're looking for
text – the sentence we're looking for
Example 1 program szukajslowo string w = 'Cześć jestem programista' int pozycja = szukaj('programista',w) print_line(wynik) //Result 16 Example 2 program szukajslowowzdaniu string zdanie_testowe = 'Cześć jestem programista' string szukany_tekst = 'programista' int pozycja = szukaj(szukany_tekst, zdanie_testowe) jeśli pozycja > 0 wtedy pisznl('znalezione: '+ szukany_tekst + ' pozycja: ' + LiczbacWTekst(pozycja)) inaczej pisznl('brak szukanego słowa') |
zamień_tekst(oryginalny_tekst, szukany_tekst, nowy_tekst) |
-- |
Replaces all occurrences of szukany_tekst with nowy_tekst. Parameters
Example 1 program przyklad_zamien_tekst string oryginalny_tekst = 'Ala ma kota.' string zmieniony_tekst = '' string szukany_tekst = 'kota' string nowy_tekst = 'psa' zmieniony_tekst = zamień_tekst(oryginalny_tekst, szukany_tekst, nowy_tekst) print_line(zmieniony_tekst) // Resuly: Ala ma psa |
duże_litery_ansi(s) |
-- |
Converts string to UPPERCASE, with support for Polish characters
Example program duze_litery string a = 'Zażółć gęślą jaźń' a = duże_litery_ansi(a) print_line(a) // Result: ZAŻÓŁĆ GĘŚLĄ JAŹŃ |
Module Import (1)
| Polish name | English name | Description |
|---|---|---|
importuj module-name |
import module-name |
Imports a Pascal module into the project. |
Code snippets in other languages(3)
| Polish name | English name | Description |
|---|---|---|
asm {assembly code} → |
import module-name |
Inserting assembly code into Avocado
Example asm{ asm mov eax, 7 mov ebx, 8 imul eax, ebx mov wynik, eax end; } |
pascal{Pascal code} |
pascal{Pascal code} |
Inserting a Pascal Code Block in Avocado
pascal{ if liczba > 0 then WriteLn('Liczba jest dodatnia.') else if liczba < 0 then WriteLn('Liczba jest ujemna.') else WriteLn('Liczba jest równa zero.'); } |
pascal_line{Pascal code} |
pascal_linia{Pascal code} |
Inserting Pascal code on one line in Avocado
pascal_line{writeLn('Hello World')} |
If conditional statement (1)
| Polish name | English name | Description | |
|---|---|---|---|
jeżeli.. wtedy .. inaczej |
if ... then... else, |
Example of using Polish names
program warunek liczba_całkowita a = 10 jeżeli a > 5 wtedy początek pisz_linie('a>5') koniec inaczej pisz_linie('a<5') |
Example English names:
program warunek int a = 10 if a > 5 then start print_line('a>5') end else print_line('a<5') |
Comments (2)
| Name | Description |
|---|---|
//Comment |
One line of code will be commented out |
(* code *) |
Multi-line commentary |
Types of loops(9)
| Polish name | English name | Description | |
|---|---|---|---|
dla .. do .. wykonać{} |
for ... to ... do |
Used when you know in advance how many times you want to execute the code. The counter changes automatically. Example of Polish names program forto lc i = 0 dla i = 1 do 4 wykonać pisz_linie(i) |
Example English names program forto int i = 0 for i = 1 to 4 make print_line(i) |
przerwać |
break |
Helper function - immediately terminates the loop Example of Polish names program fortobreak liczba_całkowita i = 0 dla i = 1 do 4 wykonać początek jeżeli i = 3 wtedy przerwać pisz_linie(i) koniec |
Example English names program fortobreak int i = 0 for i = 1 to 4 do start if i = 3 then break print_line(i) end |
kontynuować |
continue |
Helper function - skips the rest of the current iteration and moves on to the next one Example of Polish names program fortobreak liczba_całkowita i = 0 dla i = 1 do 4 wykonać początek jeżeli i = 3 wtedy kontynuować pisz_linie(i) koniec |
Example English names program fortobreak int i = 0 for i = 1 to 4 do start if i = 3 then continue print_line(i) end |
etykieta |
label |
The auxiliary function label is a label for jumping, used together with the keyword jump. It's a "tag" in the code that you can jump to anywhere within the same procedure or block. Example of Polish names program testlabel etykieta skok liczba_całkowita a = 6 jeżeli a = 5 wtedy początek pisz_linie('a równa się 5') koniec inaczej początek skocz skok pisz_linie('a nie równa się 5') koniec skok: pisz_linie('tu') |
Example English names program testlabel label skok int a = 6 if a = 5 then start print_line('a równa się 5') end else start jump skok print_line('a nie równa się 5') end skok: print_line('tu') |
skocz |
jump |
The auxiliary function jump / jump Allows you to jump to a label within a procedure/block. Example of Polish names program testlabel etykieta skok liczba_całkowita a = 6 jeżeli a = 5 wtedy początek pisz_linie('a równa się 5') koniec inaczej początek skocz skok pisz_linie('a nie równa się 5') koniec skok: pisz_linie('tu') |
Example English names program testlabel label skok int a = 6 if a = 5 then start print_line('a równa się 5') end else start jump skok print_line('a nie równa się 5') end skok: print_line('tu') |
malejąco |
descending |
Countdown loop (downto) Example of Polish names program descendingtest lc i = 0 dla i = 5 malejąco 1 do pisz_linie('Liczba: ', i); |
Example English names program descendingtest int i = 0 for i = 5 descending 1 do print_line('Liczba: ', i); |
powtarzaj ... aż |
repeat ... until |
Similar to while, but the condition is checked at the end—meaning the loop executes at least once. In repeat .. until the condition marks the end of the loop—meaning as long as the condition is False, the loop repeats. Example of Polish names program repeatuntil liczba_całkowita a = 1 powtarzaj pisz_linie('a: ', a) a = a + 1 aż a >5 |
Example English names program repeatuntil int a = 1 repeat print_line('a: ', a) a = a + 1 until a >5 |
Pętla dopóki warunek wykonać |
Pętla while warunek do |
Executes as long as the condition is True. The condition is checked before each iteration. Example of Polish names program test liczba_całkowita a = 1 dopóki a <= 5 wykonać początek pisz_linie(' a: ', a) a = a +1 koniec |
Example English names program test int a = 1 while a <= 5 do start print_line(' a: ', a) a = a +1 end |
dla ... w ... wykonać |
for ... in ... do |
for .. in .. do loop (collection loop) Used to iterate over arrays, lists, sets, etc. Example of Polish names program test dla s w ['Ala', 'ma', 'kota'] wykonać pisz_linie(s) |
Example English names program test for s in ['Ala', 'ma', 'kota'] do print_line(s) |
Program Management: (2)
| Polish name | English name | Description |
|---|---|---|
zakończ(2) |
-- |
Immediate program termination. terminate(2) terminates the program with an exit code of 2. |
wyjść |
-- |
Terminates the current procedure or function. If used in the main program, terminates the program.
Przykład program test int a = 3 int b = 10 int suma = a+b jeśli suma < 10 wtedy wyjść inaczej print_line ('I don't turn off the app') |
Program Management: (1)
| Polish name | English name | Description | |
|---|---|---|---|
informacje_o_wyszukaniu |
-- |
search_record |
Is a data structure that collects file attributes, such as name, size, modification date, and attributes, into one place. It is primarily used by file search functions like FindFirst and FindNext, which populate its fields with the appropriate data. |
Mathematics module (55)
| Polish name | English name | Description |
|---|---|---|
oblicz('wyrażenie') |
calc('wyrażenie') |
The main function that calculates mathematical and trigonometric expressions. oblicz('(10+40+34)*2'). //Result 168 oblicz('2.3+3.0+40') //Result 45,30 oblicz('cos(0)') //Result 1 |
oblicz_formatuj('pi'), 5) |
calc_format('pi'), 2) |
The main function that calculates mathematical and trigonometric expressions, taking into account how many decimal places to insert. |
sin(x) |
sin(x) |
Returns the sine of angle 'x' (in radians). The argument and result are of type 'float80' (float). |
cos(x) |
cos(x) |
Returns the cosine of angle 'x' (in radians). The argument and result are of type 'float80'. The argument and result are of type 'float80'. |
tan(x) |
tan(x) |
Returns the tangent of angle 'x' (in radians). The argument and result are of type 'float80'. Note: For angles close to π/2 + kπ (where the tangent tends to infinity), the result may be a very large number or an overflow error may occur depending on the context. |
arcsin(x) |
arcsin(x) |
Returns the arcsine of x. The result is an angle in radians in the range [-π/2, π/2]. The x argument must be in the range [-1, 1]. Specifying a value outside this range will result in a run-time error (or return NaN - Not a Number). |
arcccos(x) |
arcccos(x) |
Returns the arccosine of x. The result is an angle in radians in the range [0, π]. The x argument must be in the range [-1, 1]. Specifying a value outside this range will result in a run-time error (or return NaN - Not a Number). |
arctan(x) |
arctan(x) |
Returns the arctangent of x. The result is an angle in radians in the range (-π/2, π/2). |
arctan2(x,y) |
arctan2(x,y) |
Returns the arctangent of y / x, but takes the signs of both arguments (y and x) into account to correctly determine the quadrant. The result is an angle in radians in the range (-π, π]). This is the preferred function for calculating an angle from coordinates (x, y) because `ArcTan(y/x)` does not distinguish between angles differing by π (180 degrees). If 'x' and 'y' are both 0, the result is usually 0, but the behavior may be implementation-dependent. |
degtorad(Stopień) |
degtorad(Stopień) |
Converts an angle given in degrees to radians. |
dadtodeg(Radian) |
dadtodeg(Radian) |
Converts an angle given in radians to degrees. You can also use the formulas: Radians = Degrees * Pi / 180, Degrees = Radians * 180 / Pi |
Pi |
Pi |
Represents the number π with high precision. |
cotan(x) |
cotan(x) |
Returns the cotangent of angle 'x' (in radians). This is equivalent to '1 / Tan(x)' or 'Cos(x) / Sin(x)'. Note the domain: the function is not defined for 'x = kπ' (where sine is 0) |
sinh(x) |
sinh(x) |
Returns the hyperbolic sine of x. (Calculated as (exp(x) - exp(-x)) / 2) |
cosh(x) |
cosh(x) |
Returns the hyperbolic cosine of x. (Calculated as (exp(x) - exp(-x)) / 2) |
tanh(x) |
tanh(x) |
Returns the hyperbolic tangent of x. (Calculated as Sinh(x) / Cosh(x)) |
arcsinh(x) |
arcsinh(x) |
Returns the hyperbolic arc sine of x |
arctanh(x) |
arctanh(x) |
Returns the arc hyperbolic tangent of 'x'. The 'x' argument must be in the range '(-1, 1). |
sec(x) |
sec(x) |
The secant of an angle x is the reciprocal of its cosine. Example: sec(x) = 1 / cos(x). Condition: cos(x) cannot be equal to zero (i.e. x cannot be equal to π/2 + kπ, where k is an integer). |
scc(x) |
scc(x) |
The cosecant of an angle x is the reciprocal of its sine. sin(x) cannot be equal to zero (that is, x cannot be equal to kπ, where k is an integer). Example csc(x) = 1 / sin(x). |
arccot(x) |
arccot(x) |
Condition: x must be non-zero (x <> 0). Example: arcCot(x) = arctan(1/x) |
arcsec(x) |
arcsec(x) |
Condition: The value 1/x must be in the ArcCos domain, i.e., in the interval [-1, 1]. This means that x must satisfy the condition |x| >= 1 (i.e., x <= -1 or x >= 1). Example: arcsec(x) = arccos(1/x) |
arccsc(x) |
arccsc(x) |
Condition: Similarly to the above, the value 1/x must be in the ArcSin domain, i.e., in the interval [-1, 1]. This means that x must satisfy the condition |x| >= 1 (i.e., x <= -1 or x >= 1). Example: arccsc(x) = arcsin(1/x) |
arccosh(x) |
arccosh(x) |
A function that calculates the arc hyperbolic cosine (inverse hyperbolic cosine). |
coth(x) |
coth(x) |
Hyperbolic cotangent function. |
ccsch(x) |
ccsch(x) |
Hyperbolic cosecant function. The hyperbolic cosecant is defined as the inverse hyperbolic sine csch(x) = 1 / sinh(x) |
sech(x) |
sech(x) |
Hyperbolic secant function. The hyperbolic secant is defined as the inverse hyperbolic cosine sech(x) = 1 / cosh(x) |
csc(x) |
csc(x) |
Cosecant function. The cosecant of an angle x is the inverse of its sine csc(x) = 1 / sin(x) |
abs(x) |
abs(x) |
Function Absolute value of number x
oblicz('abs(-5)') // Result: 5 |
sqr(x) |
sqr(x) |
Square function of the number x.
oblicz('sqr(4)') // Result: 16 |
sqrt(x) |
sqrt(x) |
Function Square root of number x (number must be non-negative).
oblicz('sqrt(9)') // Result: 3 |
ln(x) |
ln(x) |
Natural logarithm function.
oblicz('ln(5)') // Result: 1.61 |
power(x, y) |
power(x) |
Exponentiation function (base to power exponent).
oblicz('power(2,3)') // Result: 8 |
zwiększ(x) |
inc(x) |
Function Increments the variable x (increases it by 1).
oblicz('inc(5)') // Result: 6 |
zmniejsz(x) |
dec(x) |
Function Decrements the variable x (decreases it by 1).
oblicz('dec(5)') // Result: 4 |
ułamek(x) |
-- |
Function Returns the fractional part of a floating-point number.
oblicz('ułamek(3.1415)') // Result: 0.1415 |
losuj() |
randomize() |
Initializes the random number generator. losowy() or random() should be called before the first use to prevent the results from being repeated each time it's run. |
losowy(max) |
random(max) |
Random(max), which returns a random number in the range 0..max-1
program randomowa randomize() //Losowa liczba maksymalna 100 int a = random(100) print_line(a) |
Int(X) |
Int(X) |
Returns the integer part of the real number X (as Real) |
odd(x) |
odd(x) |
Checks whether the integer X is odd (returns Boolean). Odd(int) → Boolean |
log10(x) |
log10(x) |
Base 10 logarithm (log10(X)). |
log2(x) |
log2(x) |
Binary logarithm (log2(X)). |
sufit(x) |
ceil(x) |
Rounds up. |
podłoga(x) |
floor(x) |
Rounds down. |
hypot(x,y) |
hypot(x,y) |
Hypotenuse (X2+Y2). |
min(x,y) |
min(x,y) |
Returns the smaller of two values. |
maks(x,y) |
max(x,y) |
Returns the greater of two values. |
zaokrąglić(2.3) |
round(2.3) |
Rounding a real number to the nearest integer. |
czy_jest_nan(x) |
is_nan(x) |
Checks if a value is Not a Number (e.g., the result Sqrt(−1)). |
isinfinite(x) |
isinfinite(x) |
Checks if a value is infinite. |
isnanorinfinity(x) |
isnanorinfinity(x) |
Determines whether the floating-point value X is an invalid number (NaN) OR infinity (positive +∞ or negative −∞). Use: This is used to quickly determine whether the result of a floating-point operation is invalid or undefined in the sense of IEEE 754 arithmetic, which often requires special handling to prevent errors in subsequent calculations. |
iszero(A,[Epsilon]) |
iszero(A,[Epsilon]) |
Used to check whether the given floating-point number A is close to zero, taking into account the computational error tolerance. |
isnegative(X) |
isnegative(X) |
Used to test whether a floating-point value X is negative, including negative infinity (−∞) and negative zero (−0.0). |
isnanorinf(X) |
isnanorinf(X) |
Tests whether the floating point value X is an invalid number (NaN) OR infinity (+∞ or −∞). The function returns True if: IsNaN(X)∨IsInfinite(X) Return Value Boolean. |
odcięcie(X) |
trunc(X) |
Truncates the fractional part of a real number X (towards zero). |
Moduł internet (3)
| Polish name | English name | Description |
|---|---|---|
ping('https://avocado.doc.dimitalart.pl/') |
ping('https://avocado.doc.dimitalart.pl/') |
The function checks whether a given page is responsive.
Example program pinguje importuj internet tekst witaj = 'Witaj w programie PING' pisz_linie(witaj) //pisz_linie(ping('www.programista.art')) jeśli ping('www.programista.art') wtedy pisznl('Strona www.programista.art odpowiada!') inaczej pisznl('Nie można nawiązać połączenia z programista.art') |
pobierz_plik(‘nazwa pliku’,’gdzie zapisać + nazwa pliku’) |
-- |
Downloads a file from the Internet and saves it to the specified location.
Example program pob pobierz_plik('https://avocado.doc.dimitalart.pl/ustawienia.jpg', 'D:\bazy\info\ustawienia.jpg') |
pobierz_strone(‘nazwa pliku’, lista_tekstów, ’gdzie zapisać + nazwa pliku’) |
-- |
Pobiera stronę internetową, zapisuje jej zawartość w zmiennej typu lista_tekstów i do pliku.
Example. program pobarnie lista_tekstów a = nic pobierz_strone('https://avocado.dimitalart.pl/', a, 'D:\bazy\info\strona.html') pisz_linie('Zawartość pobranej strony:') pisz_linie(a.tekst) |
File operations (11)
| Polish name | English name | Description |
|---|---|---|
przypisz_plik(f,nazwa_pliku) |
assign_file(f,nazwa_pliku) |
Assigns the file variable f to the file named filename. |
otwórz_do_odczytu(f) |
open_read(f) |
Opens a file for reading. |
otwórz_do_zapisu(f) |
open_save(f) |
Opens a file for writing. If the file already exists, its contents are overwritten. |
otwórz_do_dopisywania(f) lub dopisz(f) |
append(f) |
Opens a file for appending. New data is added to the end of the existing file. |
zamknij_plik(f) |
close_file(f) |
Closes the file. It's very important to always close files when you're finished working with them. |
koniec_pliku(f) |
eof(f) |
End-of-file check, also in expressions/conditions "true" if end-of-file is reached, "false" otherwise |
zapisz_linie(zmienna f: plik_tekstowy; tekst) |
-- |
Writing to a file |
zapisz(zmienna f: plik_tekstowy; tekst) |
-- |
Writing to a file |
czy_istnieje_plik(nazwa) logiczny |
file_exists(nazwa) logiczny |
Checking if a file exists |
wynik_io |
-- |
Returns the error code of the last I/O operation. Important for checking whether file operations (open, write, read) were successful. If IOResult <> 0, an error occurred |
Directory operations (8)
| Polish name | English name | Description |
|---|---|---|
zmień_katalog('ścieżka') |
change_dir('path') |
Changes the current directory. |
utwórz_katalog('ścieżka') |
create_dir('path') |
Creates a new directory. |
usuń_katalog('ścieżka') |
remove_dir('path') |
Deletes a directory (the directory must be empty). |
pobierz_katalog_bieżący |
get_current_dir |
Returns the path to the current directory |
czy_istnieje_katalog('ścieżka') |
directory_exists('path') |
Checks if a directory exists. |
parametr_programu(index) |
get_argument(index) |
Returns the parameter with the index number passed to the program from the command line |
pobierz_zmienną_środowiskową(nazwa) |
get_env(name) |
Returns the value of the environment variable with the given name. |
ustaw_zmienną_środowiskową |
set_env |
Sets an environment variable. |
Objects (3)
| Polish name | English name | Description |
|---|---|---|
lista_tekstów
| -
| lista_tekstów is a class-based data type. It has:
Properties: Attributes that store data, such as the number of items in a list. Methods: Functions and procedures that perform operations on data, e.g. dodaj_element (adds an item), usuń_element (removes an item), sortuj_element (sorts a list). Events: Mechanisms for responding to user or system actions. These features are characteristic of objects. A variable of type TStringList is declared, created, and used in the same way as an object, distinguishing it from simple types such as integer or text. |
.tekst
| .text
| Dane z lista_tekstów wstaw w tekst:
Example program pobarnienowe tekst c = '' lista_tekstów a = nic c = czytajnl('Podaj link do strony: ' ) pobierz_strone(c,a,'D:\bazy\info\strona.html') pisz_linie('Zawartość pobranej strony:') pisz_linie(a.tekst) |
zwolnij |
free |
The free function means to release a resource from memory |
Colors (18)
| Polish name | English name | Description |
|---|---|---|
pozycja_kursora(x,y) |
- |
Position the cursor at a specific position in the console window. Example:
program dlugosctekstu tekst a = 'siema' liczba_całkowita i = 0 i = długość(a) pisz_linie('Tekst zawiera: ', liczba_na_tekst(i), ' znaków') |
tło_tekstu |
- |
Setting the text background color |
kolor_tekstu |
- |
Setting the text color in the console. |
czarny |
black |
Color black or use the number 0. |
zielony |
green |
Color green or use number 2. |
żółty |
yellow |
Color yellow or use the number 24. |
niebieski |
blue |
Color blue or use the number 1. |
biały |
white |
Color white or use the number 15. |
cyjan |
cyan |
Color cyan or use number 3. |
czerwony |
red |
Color red or use the number 4. |
magenta |
magenta |
Color magenta or use the number 5. |
brązowy |
brown |
Color brown or use number 6. |
jasnoszary |
light_gray |
Light gray color or use number 7. |
ciemnoszary |
dark_gray |
Color dark gray or use the number 8. |
jasnoniebieski |
light_blue |
Light blue color or use the number 9. |
jasnozielony |
light_green |
Color light green or use the number 10. |
jasnoczerwony |
light_red |
Color light red or use the number 12. |
jasnoróżowy |
light_magenta |
Color light pink or use the number 13. |
migotanie |
blink |
flicker or use the number 128. |
Code examples💻
🔹 Display "Hello World""
program hello
pisz('Hello World')
//or
print('Hello World')
🔹 Variable declarations in Polish
program deklaracje
// Liczba całkowita (Integer)
liczba_całkowita age = 18
// Liczba zmiennoprzecinkowa (Real)
liczba_zm procent = 5.5
// Wartość logiczna (Boolean)
logiczny programowac = prawda
// Znak (Char)
znak a = 'D'
pisz(a)
// Tekst (String)
tekst imie = 'Jan'
🔹 Variable declarations in English
program deklaracje
// Integer
int age = 18
// Real
real procent = 5.5
// Boolean
bool programowac = prawda
// Char
char a = 'D'
print(a)
// String
string imie = 'Jan'
🔹 Arrays
program tablica-liczb
// Tablica Liczb (array of integer)
tablicaLiczb wiek = [20,30,40,50]
liczba_całkowita i = 0
dla i od 0 do 3 {pisz(wiek[i])}
// Tablica Tekstów (array of string)
tablicaTekstów przedmioty = ['Matematyka', 'Polski', 'Angielski']
pisz('Pierwszy przedmiot: ' + przedmioty[1])
liczba_całkowita i = 0
dla i od 0 do 2 {pisz(przedmioty[i])}
🔹 Loops
program petla-for
// Pętla for
liczba_całkowita i = 0
dla i od 5 do 10 { pisz(i) }
🔹 Type conversion
program konwersje
// Liczba rzeczywista → Tekst
liczba_zm a = 5.5
tekst b = zmiennoprzecinkowa_na_tekst(a)
pisz(b)
// Liczba całkowita → Tekst
liczba_całkowita a = 5
tekst b = liczba_na_tekst(a)
pisz(b)
// Tekst → liczbę całkowitą
tekst a = '5'
liczba_całkowita b = tekst_na_liczbę(a)
pisz(b)
// Dodawanie po konwersji
tekst a = '5'
liczba_całkowita b = tekst_na_liczbę(a)
liczba_całkowita suma = b + 10
pisz(suma)
🔹 Arithmetic operations Polish names
program matematyka
// Dodawanie
liczba_całkowita a = 5
liczba_całkowita b = 15
liczba_całkowita suma = a + b
pisz(suma) // Wynik: 20
// Odejmowanie
liczba_całkowita a = 5
liczba_całkowita b = 15
liczba_całkowita wynik = a - b
pisz(wynik) // Wynik: -10
// Mnożenie
liczba_całkowita a = 5
liczba_całkowita b = 15
liczba_całkowita iloczyn = a * b
pisz(iloczyn) // Wynik: 75
// Dzielenie
liczba_całkowita a = 5
liczba_całkowita b = 15
liczba_zm wynik = b / a
pisz(wynik) // Wynik: 3.0
🔹 Arithmetic operations English names
program matematyka
// Addition
int a = 5
int b = 15
int suma = a + b
print(suma) // Wynik: 20
// Subtraction
int a = 5
int b = 15
int wynik = a - b
print(wynik) // Wynik: -10
// Multiplication
int a = 5
int b = 15
int iloczyn = a * b
print(iloczyn) // Wynik: 75
// Division
int a = 5
int b = 15
razl wynik = b / a
print(wynik) // Wynik: 3.0
🔹 Downloading data from the user Polish names
program dane
tekst name = czytaj('Twoje imię: ')
tekst surname = czytaj('Twoje nazwisko: ')
tekst wynik = name + ' ' + surname
pisz_linie(wynik)
🔹 data formatting
program form
program forma
importuj formatowanie
tekst imie = 'Anna'
liczba_całkowita wiek = 30
liczba_zm wzrost = 1.57
liczba64 pesel = 12345678901
piszf('Dane użytkownika:', [])
piszf('Imię: %s', [imie])
piszf('Wiek: %d lat', [wiek])
piszf('Wzrost: %.2f m ', [wzrost])
piszf('Pesel: %.d ', [pesel])
piszf('Zapisano: %.d%% danych ', [100])
piszf('Imię: %s, Wiek: %d lat, Wzrost: %.2f', [imie, wiek, wzrost])
piszf('Wzrost: %f', [wzrost])
piszf('Wzrost: %.2f', [wzrost])
🔹 Commenting code
program hello
pisz('Siema')
//pisz('Siema') będzie ignorowane przez kompilator
🔹 Conditions
program warunki
// Instruction if-else
liczba_całkowita a = 5
jeśli a > 10 wtedy pisz('a jest większa od 10')
inaczej pisz('a jest mniejsza lub równa 10')
🔹 Text concatenation
program klient
tekst imie = 'Jan'
tekst nazwisko = ' Kowalski'
tekst klient = imie + nazwisko
pisz(klient) // Wynik: Jan Kowalski
🔹 Math module
program obliczenia
importuj matematyka
oblicz('(10+40+34)*2')
oblicz('2.3+3.0+40')
oblicz('cos(0)')
oblicz('cos(pi/2)')
oblicz('2 * sin(pi/6)')
oblicz('cosh(0)')
oblicz('arcsin(0.5) * 180/pi')
oblicz('sinh(1)')
oblicz('cosh(0)')
oblicz('2.3+3.0')
oblicz('arccos(0.5) * 180/pi')
oblicz('arccot(1)')
oblicz('arcsec(2)')
oblicz('arccsc(2)')
random number program
program randomowa
randomize()
//Losowa liczba maksymalna 100
int a = random(100)
print_line(a)