Deadfish 2
Deadfish with five more letters, enough to print words and to echo what you type.
M654, 2016 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
M654 made Deadfish 2 in 2016 as a superset of Deadfish. It keeps the one accumulator and the old rule that -1 and 256 turn into 0. It adds a string next to the accumulator, a way to print the accumulator as a character, a reset and a halt. There are still no loops or conditions, so every program runs straight through once.
The machine
| Char | Does |
|---|---|
i d | Add 1, subtract 1 |
s | Square |
n | Set to 0 |
o | Print the number |
c | Print the number as a character |
r | Read a line of input into the string |
O | Print the string |
h | Halt |
After every command an accumulator of -1 or 256 becomes 0.
Example
The Hello world reaches 72 as 2 squared, plus 4, squared, plus 8.
The Hello world reaches 72 as 2 squared, plus 4, squared, plus 8. From there it walks up and down to each next letter, 79 steps down from o to the space. The w comes from going down to 11, squaring to 121 and taking 2 off.
The second is the cat. It reads the input into the string, prints it and halts.
Further
- esolangs.org/wiki/Deadfish_2
- Deadfish, the language it extends.
Ideas it shows
See also
Also in Jokes
Write your own in Run Convert a program from Deadfish 2
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: deadfish-2.
Command line
shib run deadfish-2 -e 'rOh' --input 'Hello, World!'shib manual deadfish-2Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/deadfish-2.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org