YABALL is a language inspired by Brainfuck, invented by Jannis Harder in 2005. Its aim is to add a more obscure code flow to Brainfuck. YABALL has a 2-dimensional code flow and 2 different flow modes. It's an acronym for Yet Another Brainfuck A Like Language. By an impossible accident the name YABALL has the same pronounciation as the Polish word for a cheap apple wine.
|+||Increment the current cell.|
|-||Decrement the current cell.|
|>||Move to the next cell.|
|<||Move to the previous cell.|
|[||If current cell is 0 nop, else go down.|
|]||Go up and change to reverse-mode.|
|,||Input to the current cell. (see Misc Input & Output)|
|.||Output the current cell. (see Misc Input & Output)|
|?||Change to reverse-mode.|
|@||Quit the program. (Current cell is the exit code)|
|!||Change to normal-mode.|
All other commands are nop.
There are two different modes, which have their own command-set:
The normal-mode is for calculations, input/output and code flow. In normal-mode the current command is executed and the program-pointer moves right. (E.g. + is: Increment the current cell and go right)
Note: ] switches in reverse-mode so it moves left and not right
The reverse-mode is for Loops and code flow. It acts like the normal-mode but moves left after the current command.
The code filled with spaces, until all lines have the same length. If the program-pointer reaches the right end of a line, it wraps to the left of the next line. If the program-pointer reaches the left end of a line, it wraps to the right end of the previous line. The last line wraps to the first and reverse.
The use of mode switching and wrapping is a sign for good YABALL coding style.
The cell size is 16 bit
Input & Output
Input returns -1 on EOF.
Output outputs a byte to stdout if the current cell is less than 256. If the current cell is less than 512, the value-256 is written to stderr. 512 closes stdout and 513 closes stderr. Values from 514 to 32767 inclusive are reserved for future extensions. Other values may be used for anything.
Cat (mode switching):
,+[@ -v ^ .
YABALL is Turing-complete as there are two ways converting a Brainfuck program into a YABALL program.