Deadfish x
Deadfish in xkcd letters, with twice the commands and one-letter functions.
firefly431 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
Deadfish x keeps Deadfish's one number and its rule that the number falls back to 0 once it leaves 0 to 255. The four commands use the xkcd spelling x, k, c, d. Four capital letters are added. One prints a character, one resets, and two define and call functions named by a single letter, so a run of letters can be reused.
The machine
| Command | Does |
|---|---|
x d | Add 1, subtract 1 |
c | Square |
D | Set to 0 |
k | Print the number and a newline |
K | Print the number as a character |
X + letter | Start defining that function; its body runs to the next C |
C + letter | Run that function |
Before every character the number is checked, and anything below 0 or above 255 becomes 0. So xxcc gives 16, and one more c gives 256, which turns to 0 before the next command.
Example
The alphabet defines U as "add one and print".
The alphabet defines U as "add one and print". Then it builds 64 as 2 squared, plus 4, squared, and calls U 26 times.
Further
Ideas it shows
See also
Also in Jokes
Write your own in Run Convert a program from Deadfish x
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: deadfish-x.
Command line
shib run deadfish-x -e 'XUxKCxxcxxxxcCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCUCU'shib manual deadfish-xSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/deadfish-x.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org