HeacunQ9+×
HQ9+ with six more commands, enough for a truth machine and a cat.
AmNow, 2022 · Turing complete: no · ●○○ easy · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
AmNow made HeacunQ9+× in 2022 from HQ9+, the joke language whose H prints Hello World and whose 9 prints the whole of 99 bottles of beer. It keeps all four of HQ9+'s commands and adds six. One stores a function, two run it, one does arithmetic and two read or print the accumulator.
Read the story
esolangs.org files it under unusable for programming. It still has a truth machine and a cat.
The machine
| Command | Does |
|---|---|
H | Print Hello, World! |
Q | Print the program |
9 | Print the 99 bottles of beer song |
+ | Add 1 to the accumulator |
C...C | Work out the arithmetic between the two C into the accumulator |
A...A | Keep the text between the two A as the function |
E | Run the function |
× | Run the function if the accumulator is not 0 |
U | Read a number if the accumulator is -1, else print it |
N | The same with one character |
The accumulator starts at 0. Every other character is ignored.
Example
The truth machine.
The truth machine. C-1C sets the accumulator to -1, so the first U reads the input. The function UE prints and runs itself again, and × starts it only on a number other than 0. On 0 the last U prints 0 once.
Patterns it teaches
- Quine:
Qprints the program, soQon its own is a quine.
Further
See also
Also in Jokes
Write your own in Run Convert a program from HeacunQ9+×
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: heacunq9.
Command line
shib run heacunq9 -e 'H'shib manual heacunq9Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/heacunq9.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org