VAST
Two wheels choose what a space does. Most of a program is turning them to the right place.
Zero player rodent · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 5 known programs · Test method
Run it
The idea
VAST is a turning tarpit by Zero player rodent. The space is the only command that does anything to the data, and what it does depends on two wheels. Wheel 1 has five positions and wheel 2 has five, and other characters turn them. The specification says it has many commands for a tarpit because its maker did not want the code to look like other languages.
Read the story
There are two cells, both 1 at the start, and a stack. To print an a the specification counts cell 1 up to 10 with nine spaces, doubles it three times to 80 with _, counts on to 97, then turns the wheels to push it and print it.
The machine
| Wheel 1 at | A space | Wheel 2 at | A space |
|---|---|---|---|
| 0 | Points at cell 1 | 1 | Points at cell 2 |
| 2 | Adds 1 to the cell | 3 | Pushes the cell |
| 4 | Points at a random cell | 4 | Prints the top of the stack |
After a space, wheel 1 turned more than 4 times goes back to -1 and wheel 2 to 0.
| Char | Does |
|---|---|
~ = | Turn wheel 1 or wheel 2, when wheel 1 is turned 2 times or fewer |
^ - | Turn wheel 1 or wheel 2, when wheel 1 is turned 2 times or more |
/ | Pop |
] _ | Set the cell to 0; double it |
v | Push a byte of input |
; | Go past the next : if the top is 0 |
: ! | Go back to the last ; if the top is above 0, or not 1 |
| pops when the top equals the cell. The specification's table writes it as an l and its programs use |, so this implementation takes both.
The specification does not say in which order the two wheels act inside one space. Its hello prints hello only when the pointer moves first, then the cell is counted, then the stack is used, so this implementation does that. The program that reverses its input does not reverse under any reading tried.
Example
The walk through, which prints an a, and its hello.
The walk through, which prints an a, and its hello.
The if/else counts cell 1 to 48 and 49 and pushes both. Then it reads a character and drops it with | if it equals 49, the code of 1. / pops once more and the space prints what is on top.
The cat. The end of the input ends the run.
Further
See also
Turning tarpits
Cell-based
Write your own in Run Convert a program from VAST
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: vast.
Command line
shib run vast -e '~~ === =^^^;v /:' --input 'abc'shib manual vastSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/vast.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org