Sickfrog
Frog, but the frog is sick. Whatever you ask it to say, it gets five letters out.
Stysan · Turing complete: no · ●○○ easy · esolangs.org
Tested with 7 known programs · Test method
Run it
The idea
Stysan made Sickfrog as a remake of Frog, with a syntax after Windows batch files. A program is a list of lines and runs once from top to bottom, with no loops and no jumps, so every program ends. The frog prints only characters 3 to 7 of a line, so longer text has to be cut into pieces of five.
Read the story
The specification's table and examples call the answer check bark, but the original interpreter in the specification only knows ba, be and cl. This implementation follows the interpreter. Like Frog's, its error handling catches its own quit(), so a line it does not know prints ERROR twice.
The machine
| Line | Does |
|---|---|
cr text | Print the first five characters of the text |
nl | Print a line feed |
qu text | Print the first five characters and read a line as the answer |
ri text | Set the right answer, all of it |
ba | Print True or False |
be n | Print a random whole number from 1 to n |
cl n | Sleep n seconds |
*text | A comment |
Example
The quiz cuts its question into pieces of five and asks the last piece with qu.
The quiz cuts its question into pieces of five and asks the last piece with qu. Its pieces spell "esesolangs". Then it reaches bark, which the interpreter does not know.
With the interpreter's own ba the check works.
Patterns it teaches
- Camouflage: the commands are frog sounds cut short.
Further
See also
Also in Jokes
Write your own in Run Convert a program from Sickfrog
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: sickfrog.
Command line
shib run sickfrog -e 'nl'shib manual sickfrogSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/sickfrog.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org