BigFish
Deadfish with as many registers as you make, and a loop that counts.
Yes, 2022 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
The user Yes made BigFish in 2022, after Deadfish. Deadfish has one accumulator. BigFish starts with no registers at all, and new makes the next one, numbered from 1. Every Deadfish command then names the register it works on.
Read the story
It adds one control structure, loop n { }, which runs its body n times. The count is a number written in the program, so every BigFish program stops. The specification counts it as a joke language with output only.
The machine
| Command | Does |
|---|---|
new | Make the next register, holding 0 |
i 1 d 1 | Add or take away 1 from register 1 |
s 1 | Square register 1 |
o 1 | Print register 1 |
loop 10 { } | Run the body 10 times |
o prints the number and a line feed, and there is no Deadfish reset at 256.
Example
One program prints 1 to 100 with one loop, and another with a loop of 10 inside a loop of 10.
One program prints 1 to 100 with one loop, and another with a loop of 10 inside a loop of 10.
Squaring grows fast. Register 1 goes 2, 4, 16, 256, 65536.
Patterns it teaches
- Turing completeness: unbounded registers, but no loop that depends on the data, so it is not complete.
Further
See also
Also in Jokes
Write your own in Run Convert a program from BigFish
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: bigfish.
Command line
shib run bigfish -e 'new
loop 100
{
i 1
o 1
}'shib manual bigfishSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/bigfish.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org