esolang

死鱼……吗?

Dead fish, or not? Deadfish in Chinese characters, with roots, halves and input.

PSTF, 2024 · Turing complete: unknown · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: 4

The idea

PSTF made 死鱼……吗? in 2024. The name reads sǐ yú ma, dead fish, or not. It starts from Deadfish, whose commands add 1, take 1, square and print one number, and it drops the rule that keeps Deadfish's number under 256. Every command has two spellings, a Chinese character the specification calls Dragon King and a letter it calls ASCII Fish.

Read the story

The specification has a second table with a tape, four accumulators, functions, loops and if-else. It gives no program that uses them and leaves how they are written open. This implementation is a subset. It builds the first table, where both example programs live, and stops with an error on a character of the second.

The machine

Dragon KingASCII FishDoes
上 下i dAdd 1; take 1
置wReset to 0
跳SSkip the next command when the value is 0
方 根s RSquare; square root
飞 堕m DDouble; halve
出 写o WPrint as a number; print as a character
听 读l rRead a number; read a character

The table calls the value a in some rows and x in others. Its Hello world only works when they are the same, so this implementation treats them as one value. Roots and halves make fractions, and 出 cuts them toward 0.

Example

The XKCD random number squares 2 and prints 4.

The XKCD random number squares 2 and prints 4.

The Hello world reaches H as 3 squared, less 1, squared again, plus 8. 写 prints and keeps the value, so each letter starts from the one before.

Expected: Hello, world!

Unlike Deadfish it reads input. 听 reads 21 and 飞 doubles it, then 读 reads the x and 写 prints it back.

Expected: 42x

Further

死鱼……吗? builds on Deadfish~.

Deadfish derivatives

CJK

Write your own in Run Convert a program from 死鱼……吗?

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: u6b7b-9c7c-2026-2026-5417-ff1f.

Command line

shib run u6b7b-9c7c-2026-2026-5417-ff1f -e '上上方出'
shib manual u6b7b-9c7c-2026-2026-5417-ff1f

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/u6b7b-9c7c-2026-2026-5417-ff1f.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org