Yugoslavic
- This is still a work in progress. It may be changed in the future.
Yugoslavic(Југославија) is a pseudo-natural programming language designed by PSTF, based on Srpski and LOLCODE.
There are two variant of Srpski: One is Cyrillic and another is Latin. We use Cyrillic variant.
There are six variant of this language: Srpski(Serbian), Slovenščina(Slovenian), Македонски(Macedonian, Makedonski), Bosanski(Bosnian), Hrvatski(Croatian), and Montenegrin. Most useful variant is Srpski.
Command Table
If you're Serbian, you should understand this very well.
Code | Comment |
---|---|
Почните са [Верзија].
|
In all Yugoslavic programs, Почните са [Верзија]. introduces the program and specifies the version (although it isn't used yet). |
Егзегеза: Comment
|
Introduces a single line comment. |
Егзегеза: Comment
|
Introduces a multi line comment. |
Представљамо стандардну библиотеку [x].
|
Includes a library. |
Излаз [нешто].
|
Prints STRING to the standard output stream. If ", без прелома реда" is added outside the string, no newline will be printed. |
Инпут [var].
|
Reads a string from the standard input stream into the variable. |
Декларисање променљиве [x].
|
Declares a variable without a value. Its type will be Празно. |
Декларишите променљиву [x] и доделите вредност [y].
|
Declares a variable and assigns a value to it. |
Декларишите променљиву [x] и подесите тип на [y].
|
Declares a variable of the specified type and assigns the initial value of that type to it. (See Types) |
Декларисање променљиве [x] и иницијализовање на [y].
|
Declares a variable and copies the contents of the other variable into the newly created variable. This is only valid if the other variable is a Структура. |
Претворите [x] у [y]
|
Assigns a value to a variable. |
[x] једнако [y]
|
Compares two expressions (a variable, a value or another comparison). Returns истина if both expressions have the same value. |
[x] није једнако [y]
|
Compares two expressions (a variable, a value or another comparison). Returns истина if both expressions have different values. |
[x] већи од [y]
|
Compares two expressions (a variable, a value or another comparison). Returns истина if x>y. |
[x] није већи од [y]
|
Compares two expressions (a variable, a value or another comparison). Returns истина if x≤y. |
[x] мање од [y]
|
Compares two expressions (a variable, a value or another comparison). Returns истина if x<y. |
[x] није мање од [y]
|
Compares two expressions (a variable, a value or another comparison). Returns истина if x≥y. |
[x] и [y] су већи
|
Returns the bigger of the two given expressions. |
[x] и [y] су мањи
|
Returns the smaller of the two given expressions. |
[x] плус [y] or [x]+[y]
|
Calculates [x] + [y] |
[x] минус [y] or [x]-[y]
|
Calculates [x] - [y] |
[x] помножите [y] or [x]*[y]
|
Calculates [x] * [y] |
[x] осим [y] or [x]/[y]
|
Calculates [x] / [y], result in float |
[x] количник осим [y] or [x]//[y]
|
Calculates [x] / [y], result in integer |
[x] је остатак [y] or [x]%[y]
|
Calculates [x] modulo [y] |
Замените [k1], [k2](, [k3](, [k4]...... повезани заједно.
|
Concatenates the given Нискеs. |
Претвори [x] у тип [y].
|
Explicitly casts the expression to the given type. If the expression is a variable it is not changed. To also change a variable use Претворите [x] у Претвори [x] у тип [type].. |
Претвори [x] да укуцате [y] заувек.
|
Explicitly casts a variable to the given type. The value of the variable is changed to the new type. This is equivalent to Претворите [x] у Претвори [x] у тип [type].. |
Објашњење[x]
|
Interprets a Ниске variable as an identifier. |
Ако [x] се изврши {code1} у супротном {code2} |
An if statement. If the expression can be evaluated to истина (equivalent of true) the изврши branch is executed, otherwise the супротном branch is executed. You can construct elif by У супротном, ако [x2] изврши {code}. |
Пронађи вредност [x]. Ако је [v1], извршите {code1} Ако је [v2], извршите {code2} …… Ако није ништа, извршите {codeN} Дођите до краја. |
The Пронађи вредност-statement compares the expression to the values of the извршите-statements. The values must be distinct and literal, i.e. they mustn't contain any variables or expressions which have to be evaluated at runtime. The извршите block can be followed by any number of statements and can be terminated with Престани. If an извршите-block is not terminated with Престани the next извршите will be executed too, regardless of the comparison value. The default case (није ништа, извршите) is executed when no value matches the expression. |
Поновите {code} све док [x]. |
Runs code until x is лажан. |
Поновите {цоде} до [x]. |
Runs code until x is истина. |
Извршите {цоде} за оба [y] у [x]. |
An iterative loop. |
Заврљим.
|
Заврљим. terminates the program.
|
Function
Дефинишите функцију "x". Листа параметара: *Листе параметара, **листе параметара са вредностима Some Code У реду!
Types
Празно(VOID)
"Празно" is the most common variable type and is the type of variable that is not initialized of all. It can only be converted to a Булову value and return false.
Булову(BOOL)
"Булову" is the logical value -- It can be either истина or лажан. Empty things("", [], 0, 0.0000000000000000000000) will be лажан, others will be истина.
Тип броја
A Целобројни means an integer, has a range of ℤ. Every number without a dot will be treat as Целобројни.
A Децимални разломак means a float number, has a range of ℝ. If a number ends with three dots at the end, it means that it is an infinite decimal (if it is preceded by at least three cyclic sections, it is an infinite cyclic decimal, otherwise it is an infinite non-cyclic decimal).
Ниске(STRING)
Strings are enclosed in double quotation marks. If a string is not enclosed, an error is thrown. All characters represent their numeric values, except for escape characters.
- \п ---- Преломи линија
- \х ---- Хоризонтална табела
- \и ---- Избришете
- \м ---- Мелодије звона
- \0 ---- NULL
- \x[hhhh] ---- Hexadecimal character
- \[ddddd] ---- Decimal character
- {var} ---- output the variable
- \Н(\") ---- Пар Наводници
- \н(\') ---- Једном Наводници
- \З[character name] ---- output the character named [character name]. For example, Cyrillic capital letter El outputs Л, Sinhala letter Kantaja Naasikyaya outputs ඞ, CJKV Unified Ideogram 0x3400 outputs 㐀, and so on.
- \в ---- Вертикална табела
Листе
A list is some element quoted in []. It works like in C++.
Структура
A Структура can be defined as this:
Декларишите прилагођени тип "x". Атрибут Метод У реду!
To call an attribute of a struct, use Променљиве.Атрибут, and for method use Променљиве.Метод(*Листе параметара, **листе параметара са вредностима)
Examples
Здраво свете!
Почните са 0. Излаз "Здраво свете!". Заврљим.