esolang

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

Expected: Hello, World!

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

DockDoes
[ ] _ \|Walk right, left, down, up
> < v ^Cast right, left, down, up
+ -Cast one further or shorter
CCast
?Turn toward = if the cell equals the next, else toward !
D = !Nothing
FishDoes
` | Text mode on or off
P N IPrint the cell; print it with a newline; read a line into it
{ } ENext cell; previous cell; empty the cell
n i dMake it a number; add 1; take 1
a m D p SAdd, multiply, divide, power with the next cell; square
r f l c sReverse; 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.

Expected: 0

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

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 fishing

Source

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