You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vilmos is an interpreted programming language that uses colors and pictures instead of code.
Its name is a tribute to the Hungarian painter Vilmos Huszár. Some of his most famous paintings
rapresent blocky shapes, just like the pixels/squares needed to write vilmos programs.
In a vilmos program, instructions are rapresented by squares of the same dimensions.
The minimum acceptable dimension is a single pixel. There is not a maximum dimension limit.
The instructions are executed starting from the upper-left corner to the lower-right corner, but of course they can also
be all on the same row.
NOTICE: An instruction, in vilmos, must match perfectly with the relative color code
so a program must be a .png image. In this way there will be no quality loss.
Instruction set is strongly inspired by SuperStack! one.
int: a 32-bit signed integer [-2147483648 to 2147483647]
string: a sequence of ASCII characters with \0 delimiter at the beginning of the string
Memory
vilmos is a stack-based language, so the memory is rapresented by a stack (a little bit "stronger" than a classic
one thanks to some powerful and useful operations provided by the language out of the box).
By default, memory has no maximum limit (it only depends to your device memory).
This can be changed setting a maximum stack size while using official interpreter.
If your vilmos painting encounters an error during runtime, the execution will be immediately stopped.
If you are using the official interpreter, when the execution is stopped, it will also be displayed an error
message that describes what happened.
This can be avoided by using the debugger tool provided out of the box by the interpreter.
Gets value from stdio as number and pushes it into the stack. If a file is opened,this instruction will read content from it and pushes all the characters in the file into the stack.
#ffffff
INPUT_ASCII
Gets values as ASCII char of a string and puts them into the stack. If a file is opened,this instruction will read content from it and pushes all the characters in the file into the stack.
#e3e3e3
OUTPUT_INT
Pops the top of the stack and outputs it as number. If a file is opened,this instruction will write values into the file as integers and not in stdout.
#000001
OUTPUT_ASCII
Pops the top of the stack and outputs it as ASCII char. If a file is opened,this instruction will write into the file as ASCII chars and not in stdout.
Opens the file using the last string in the stack as path. The string is popped from the stack. While the file is open, INPUT_ASCII and INPUT_INT instructions will read all the file content and push each char into the stack. While the file is open, OUTPUT_INT and OUTPUT_ASCII instructions will write into the file. If the file doesn't exists, it will be created. An opened file is in read-write append mode. Only one file can be opened at a time.
#91f68b
FILE_CLOSE
Closes the currently opened file. INPUT_ASCII, OUTPUT_ASCII, INPUT_INT and INPUT_ASCII will return to their standard behaviour.
vilmos supports the possibility to insert into the stack integers and strings directly from the given image.
When an operation square is encountered and its color code doesn't match with any of the default/custom color codes
defined, the sum of red, green and yellow operation square's value is pushed into the memory.
NOTICE: When pushing a string into the stack, remember to insert at the beginning of the string the \0 delimiter (rapresented by #000000 RGB value)
Thanks to this delimiter it is possible to have in memory multiple strings and integers at the same time.
It is also possible to insert a single char, but remember to insert the delimeter!
Example program that inserts 100 in memory and outputs it:
Example program that inserts 'vilmos' string in memory and outputs it: