Turi ip ip ip
A stack language spoken in five words. Every digit is counted out in ip.
2022 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
Turi ip ip ip was inspired by a viral video of the same name. A program has four kinds of statement. turi pushes a number, eugh runs the command with that number, and eugh eugh ... turisha loops while the top of the stack is not 0.
Read the story
Numbers are written one digit at a time, with commas between the digits. A digit is one ip more than its value, so ip is 0, ip ip ip ip is 3 and ip ip, ip ip ip is 12. tura before the first digit makes the number negative, and before a later digit it starts the fraction. Printing the letter H takes turi ip ip ip ip ip ip ip ip, ip ip ip and then eugh ip ip ip ip ip, ip, which is command 40.
The specification's own list of numbers reads ip ip, ip ip ip as 32. Every program on the specification counts it as 12, and so does this implementation.
The machine
| Statement | Does |
|---|---|
turi n | Push n |
eugh 1 2 3 4 | Add, subtract, multiply, divide the top two |
eugh 5 10 20 | Negate; modulo; power |
eugh 30 40 | Print the top as a number; as a character |
eugh 50 | Read a line and push its characters, the first on top |
eugh 100 200 | Duplicate; swap |
eugh 300 | Turn the stack's ASCII digits into one number |
eugh 400 1000 | Go to the next stack; the previous one |
eugh 2000 3000 | Move the top to the backup stack; move it back |
eugh eugh ... turisha | Loop while the top is not 0 |
Statements end at a line break or a semicolon, and [text] is a comment. The stack starts empty.
Example
Six times seven, printed as a number.
Six times seven, printed as a number.
Two letters, 72 and 105.
The truth machine without its comments. It reads a line, subtracts 48 and prints 1 for as long as the result is not 0. On 0 it skips the loop and prints the 0.
The cat. It pushes a 0 as a floor, reads a line and prints characters until it reaches the 0. An empty line, or the end of the input, ends it.
The specification also has a Hello World of 13 lines and a counter that prints a growing row of asterisks, keeping its count on the backup stack.
Patterns it teaches
- Stack machines: a row of stacks and one backup stack.
- Camouflage: a program reads like a chant.
Further
See also
Stack-based
Write your own in Run Convert a program from Turi ip ip ip
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: turi-ip-ip-ip.
Command line
shib run turi-ip-ip-ip program.txt --input '0'The program is long; save it as program.txt first.
shib manual turi-ip-ip-ipSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/turi-ip-ip-ip.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org