FISH WALKING ๐ถ
A fish with legs walks along 255 cells of food, shouting every step in capitals.
MathR ยท Turing complete: yes ยท โโโ easy ยท esolangs.org
Tested with 4 known programs ยท Test method
Run it
The idea
MathR made FISH WALKING ๐ถ, based on a drawing by Iamn00b. Every command is a whole line of capitals with an emoji at the end, and the Python interpreter compares each line with the exact text. Nothing runs until the line OMG FISH WITH LEGS ๐ฃ. One command, FISH DIE ๐, gives up on the language and runs Deadfish for the rest of the session.
The machine
The fish walks a ring of 255 cells, each holding a count of food that can grow without bound or go below 0.
| Line | Does |
|---|---|
FISH WALKING ๐ถ | Move right |
FISH SWIMMING NOOOOO ๐ | Move left |
FISH GET FOOD ๐ | Add one |
FISH UNGET FOOD ๐ | Take one |
WHO WILL IT EAT DOE ๐ค | Read a line as a number |
FISH SHOW HIS FOOD COLLECTION ๐ | Print the number and a line feed |
FISH HUNGRY WHEN n FOOD ๐ด | Set the hunger, 5 at the start |
FISH TOO HUNGRY TO DO NEXT LINE LOL ๐คฃ | Skip the next line if the cell is below the hunger |
FISH FLY TO n ๐ซ | Go to line n |
FISH DIE ๐ | Run Deadfish on the input |
With a hunger of 1 the skip tests a cell for 0, and with the jump the cells work as the counters of a Minsky machine.
Example
The truth machine.
The truth machine. On 0 the fish is too hungry, skips the jump and stops.
The Deadfish interpreter. Python's input(">> ") writes its prompt to the output before each line it reads, and the session ends with the input. In this implementation 0 goes up to 2, is squared twice to 16 and printed.
Patterns it teaches
- Counter machines: increment, decrement and a test for 0.
See also
Also in Jokes
Write your own in Run Convert a program from FISH WALKING ๐ถ
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: fish-walking.
Command line
shib run fish-walking -e 'OMG FISH WITH LEGS ๐ฃ
FISH DIE ๐' --input 'iisso'shib manual fish-walkingSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/fish-walking.js
Docs: Kernel instructions ยท The .shib format ยท Command line ยท Adding a language
Source esolangs.org (CC0) ยท Edit on esolangs.org