Vertical
Twelve commands, and every one of them is an upright stroke.
Deppong, 2020 · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Deppong made Vertical in 2020 to be unreadable. Its commands are l, I, 1, |, ), (, [, ], T, /, \ and !, characters that all look like a line standing up. A program reads like a fence. Like brainfuck it ignores every other character, so spaces and line breaks can lay it out.
Read the story
There is one stack and one register. The register counts up and down and gets pushed; the stack holds the values and is the only thing a loop can test.
The machine
| Command | Does |
|---|---|
1 \| | Add 1 to the register, take 1 from it |
) | Set the register to 0 |
l | Push the register |
I | Pop |
[ ] | Add 1 to the top of the stack, take 1 from it |
T | Swap the top two |
/ \ | A loop; \ goes back to its / while the top is not 0 |
! | Print the top as a character |
( | Read a character into the register |
The specification does not say whether / tests the top. This implementation reads it as a plain mark, so a loop runs at least once. At the end of the input ( gives 0.
Example
The Hello World without its formatting.
The Hello World without its formatting. It builds the characters on the stack from the last one down, the line feed first and H last, then prints the top 13 times with a pop between each two.
A loop multiplies. The register is set to 8 and pushed as the counter, then the loop adds 8 to the register and takes 1 from the counter, 8 times. One more gives 65, which is A.
The cat is (l!/(l!\. It prints each character it reads and stops when it reads a 0, so it also prints the 0 it gets at the end of the input.
Patterns it teaches
- Stack machines: a stack with a single register to fill it.
- Camouflage: the program hides in a field of strokes.
Further
See also
Stack-based
Write your own in Run Convert a program from Vertical
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: vertical.
Command line
shib run vertical -e '(l!/(l!\' --input 'cat '