Fishing
A fisherman walks along a dock, casts his line, and whatever fish he catches is the instruction.
OriginalOldMan, 2013 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
OriginalOldMan made Fishing in 2013. The program is a grid with two kinds of characters. The dock is where the fisherman walks: it turns him, sets the length and direction of his cast, and with C makes him cast. The fish are the characters he lands on when he casts. They are the real commands, and they stay in the water after he catches them.
Read the story
So code is placed in two dimensions twice over. The dock decides the order, and the fish can sit anywhere the line reaches. Step off the dock and the program ends. Catching a backquote turns on text mode, and then every fish caught is added to the current cell as a character, which is how text gets into memory.
The machine
| Dock | Does |
|---|---|
[ ] _ \| | Walk right, left, down, up |
> < v ^ | Cast right, left, down, up |
+ - | Cast one further or shorter |
C | Cast |
? | Turn toward = if the cell equals the next, else toward ! |
D = ! | Nothing |
| Fish | Does |
|---|---|
` | Text mode on or off | |
P N I | Print the cell; print it with a newline; read a line into it |
{ } E | Next cell; previous cell; empty the cell |
n i d | Make it a number; add 1; take 1 |
a m D p S | Add, multiply, divide, power with the next cell; square |
r f l c s | Reverse; negate; push the tape length, a join, the characters |
Example
The Hello World.
The Hello World. v points the line down and + makes it one long, so each C catches the character below it.
The truth machine. It writes a 1 into the first cell, reads the input into the second, and ? compares them. A 0 sends the fisherman down past the ! to print the input once; a 1 sends him right, where he walks back and forth over a C that catches P forever.
The specification also has a Deadfish interpreter that reads one command per line. It prints >> before each command and numbers the way Ruby prints floats, such as 4.0.
Further
Ideas it shows
See also
Two-dimensional languages
Cell-based
Write your own in Run Convert a program from Fishing
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: fishing.
Command line
shib run fishing -e 'v+CC
IN' --input 'fish
'shib manual fishingSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/fishing.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org