菜就多练
Deadfish in four Chinese characters, with no bounds on the number and a command that prints it as a character.
PrySigneToFry, 2024 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 2 known programs · Test method
Run it
The idea
PrySigneToFry made 菜就多练 in 2024 from deadfish. The specification opens with a short verse whose first line, 菜,就多练, is the name, and the four characters of the name are the four commands.
Read the story
Deadfish prints its accumulator as a number and sets it back to 0 when it reaches -1 or 256. 菜就多练 prints it as a character instead. The Python interpreter on the specification leaves out both of deadfish's rules, and a comment in it says the examples do not show whether they apply. So the number has no bounds, as in the Python.
The machine
| Character | Deadfish | Does |
|---|---|---|
菜 | i | Add 1 |
就 | d | Take 1 away |
多 | s | Square |
练 | Print the character with that code |
The accumulator starts at 0. Every other character prints Unrecognised command. and a line feed, as the Python does. The Python reads the program as one line; this implementation passes over line breaks, so a program can wrap as it does in the specification.
Example
The XKCD random number makes 8, squares it to 64 and counts down 16 to 48, the code of the digit 0.
The XKCD random number makes 8, squares it to 64 and counts down 16 to 48, the code of the digit 0.
The Hello, world! squares twice at the start. 3 squared is 9, one less is 8, and 8 squared is 64; eight more make 72, which is H.
A space is not a command, so it prints the Python's complaint. 3 squared twice is 81, which is Q.
Patterns it teaches
- Encoding tricks: deadfish's letters swapped for the words of a saying.
Further
See also
菜就多练 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: u83dc-5c31-591a-7ec3.
Command line
shib run u83dc-5c31-591a-7ec3 -e '菜菜菜菜菜菜菜菜多就就就就就就就就就就就就就就就就练'shib manual u83dc-5c31-591a-7ec3Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/u83dc-5c31-591a-7ec3.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org