Appeared in:
Typing discipline:
Versions and implementations (Collapse all | Expand all):
Programming language

HQ9+ is a joke language (not even esoteric) which has only 4 instructions and is thus capable of only 4 actions:

  • H prints “Hello, World!” (the exact syntax of the printed sentence varies across implementations)
  • Q prints the text of the source code (thus, single-command code “Q” is a quine)
  • 9 prints the lyrics of “99 Bottles of Beer” (the exact text varies across different implementations as well)
  • + increments the accumulator (which you can’t access anyways)

The language was created around 2001 by Cliff L. Biffle. The language is one of the simplest esoteric languages to implement, so the most interesting thing about it is not writing about it but rather writing its interpreter.


Hello, World!:

Example for versions Ellsässer's HQ9+ 0.8

In this language any code which contains H command and doesn’t contain Q or 9 commands outputs “Hello, World!”.