Outinp
Every command is eight characters long, three for its name and five for its argument.
Win7HE, 2024 · Turing complete: with unbounded memory · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Win7HE made Outinp in 2024, with an official interpreter written in Scratch. A program is one long row of commands of exactly eight characters. The first three name the command and the other five are its argument, or a comment when it takes none. There are two variables, and the output is a Scratch list, where emp starts a new item.
Read the story
The specification shows how two variables could run a Minsky machine, but jmp takes five digits and so reaches no further than command 99999. That makes Outinp a bounded-storage machine.
The machine
| Command | Does |
|---|---|
out##### | Print the five characters |
inp##### | Ask for an answer, with the five characters as the question |
oui$$$$$ | Print the answer |
emp$$$$$ | Start a new line |
1in##### 2in##### | Add the number to variable 1 or 2 |
ini$$$$$ | Add the answer to variable 1 |
iff###$$ | Skip the next command if variable 1 is not the number |
swp$$$$$ | Swap the two variables |
ouv$$$$$ | Print the character whose code is in variable 2 |
jmp##### | Go to that command |
nop$$$$$ | Nothing |
Each $ may be any character. An answer is one line of the input, commands count from 1, and a jump to a command that is not there ends the run.
Example
The Hello World is three out commands.
The Hello World is three out commands. The last one prints its two dots as well.
The cat asks three times, with the question imcat, and prints each answer.
A loop. Variable 1 counts down from 3 while ouv prints variable 2, which holds 65. When variable 1 reaches 0, iff lets the jump to command 8 run.
The truth machine asks for help in its own title. Both of its branches end at command 9, which jumps to itself, so on any input it prints 123 is 1, else zero. and then loops without end.
Patterns it teaches
- Counter machines: two variables, an add, a test for a number and a jump.
Further
See also
Also in Turing tarpits
Write your own in Run Convert a program from Outinp
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: outinp.
Command line
shib run outinp -e 'outHelloout, woroutld!..'shib manual outinpSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/outinp.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org