Baltie 3
Version of implementation Baltie of programming language BaltieBaltie 3 is a version of Baltie environment which allows programming using icons from predefined set. All programming is about controlling the actions of a wizard sprite. The set of icons includes:
- sprite movement control;
- digits. Numbers are constructed from several digits put in row;
- math and logic functions: arithmetics, comparison, random numbers, some more advanced functions like trigonometry;
- coordinate controls;
- animation controls;
- flow control structures: loops, conditional statement;
- user input functions;
- data definition, data conversion and string manipulation;
- file access.
Links:
Examples:
Hello, World! - Baltie (310):
This example consists of two icons: first one is literal
and contains the message to be printed, while the second one is read key or mouse button (wait for pressing)
and basically just pauses the execution until any key is pressed.
"Hello, World!" in Baltie 3
Fibonacci numbers - Baltie (311):
The example is rather self-explanatory: boxes A..D are global variables (blue for integer, yellow for string). Arrow facing left is assignment. For loop takes variable, range start and range end as parameters in round brackets, loop body is enclosed in {} brackets.
Fibonacci numbers in Baltie 3
Fibonacci numbers in Baltie 3 (result)
Factorial - Baltie (312):
This example uses iterative factorial definition. While
loop takes a condition as parameter in round brackets. Variable out
contains the output of the example. The only tricky thing is outputting multi-line variable: to do this, one had to move the sprite to the top of the screen, so that the output isn’t truncated by the lower side of the screen. 13! overflows.
Factorial in Baltie 3
Factorial in Baltie 3 (result)
CamelCase - Baltie (313):
This example features a standard character-wise string processing. Note that the language doesn’t support boolean variables, so “previous character was a separator” is stored as an integer. Baltie 3 is a strongly typed language, so cast from character to its ASCII-code has to be done explicitly using a corresponding function.
CamelCase in Baltie 3
Quadratic equation - Baltie (314):
Quadratic equation in Baltie 3
Factorial - Baltie (451):
A shorter program to calculate factorials, provided by BohumÃr Soukup of SGP systems. It prints the factorials directly to output stream without storing them in temporary variable.
Factorial in Baltie 3 (shorter version)
Comments
]]>blog comments powered by Disqus
]]>