esolang

FISHQ9+

Deadfish and HQ9+ glued together, with a k at the end to stop.

Erinius, 2016 · Turing complete: no · ●○○ easy · esolangs.org

Tested with 2 known programs · Test method

Run it

Expected: 0

The idea

FISHQ9+ runs every Deadfish program and every HQ9+ program. It keeps Deadfish's accumulator and its odd rule that the value 256 or -1 falls back to 0. From HQ9+ it takes the commands that print a greeting, the program itself and the whole 99 bottles song. Letters are not case sensitive, and anything else is ignored.

The machine

CommandDoes
i +Add 1
dSubtract 1
sSquare
oPrint the accumulator and a newline
hPrint Hello World.
qPrint the program read so far
9Print 99 bottles of beer
kStop

The reference interpreter is 50 lines of C that read the program one character at a time. It needs a final k; in this implementation the end of the program stops it too.

Example

In the first program the third s makes 256, which turns to 0 before o prints it.
Expected: 289
Expected: 2 Hello World. iiohq

In the first program the third s makes 256, which turns to 0 before o prints it. In the second an i comes between, so the square is 17 times 17.

Further

Ideas it shows

Also in Jokes

Write your own in Run Convert a program from FISHQ9+

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: fishq9.

Command line

shib run fishq9 -e 'iissso'
shib manual fishq9

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/fishq9.js

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

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