Viktor's Divisibility Checker
Viktor's Divisibility Checker, or just Viktor is an Esoteric Programming Language created by User:Yayimhere, that checks the divisibility of different numbers in a list. It is based on a 1 register Minsky Machine, as well as the Do Minsk Family and WUUI, the second of which only inspired the creator in formatting.
Etymology
Viktor's Divisibility Checker is named after Viktor Vasnetsov, who painted the painting "Knight at the Crossroads", of which a crossroads is quite similar to Viktor's Divisibility Checker.
Semantics
Every Viktor program is made up of a list of lists, each list holding any number of integers, as well as two extra numbers, one named the "numerator" and one called the "redirect", with the whole form called a "command". Every list is on one of a finite but unbounded number of "paths". Some of these integers may be a "halt symbol" instead. There is also two special elements called the "NOP element", and the "reference element" which has an x and y symbol. All of these different things will be defined as follows
The "paths" are a specific subset of execution within the program, which all have different "commands" within them. Every "path" is indexed, with the first one having the index 0. There is a pointer, that points to the current path being ran. When the pointer moves, the line number stays the same.
Now, for every "command", we do the following:
- Check if the numerator is divisible by the first element of the list.
- If yes then decrement that element, and then do the same for the next element until the list is over(if a decrement on zero happens, it just doesn't apply).
- Else, goto the "path" with the index of the "redirect".
With the special cases of:
- If the list has a reference symbol, then replace that element with the list at the x y coordinates given, where x is the line, and y is path. Note that changes to this reference also apply to the reference itself.
- If there is a halt symbol, then halt the program.
- If there's a NOP element, then this line will simply be marked as a NOP.
When the end of the program has been reached, the program goes back to the start.
Syntax
Viktor's Divisibility Checker uses the following syntax, with each command on a different line, and each different path is separated by a space, a | and another space, with the first path being on the left of the program(note that each separator must be aligned, using space padding):
.numerator .redirect .[list elements]
With the other symbols defined as:
NOP: 0(note that this should be the only symbol on the line)
HALT: $
REFERENCE: {x,y}