Unified HQ9+

From Esolang
Jump to navigation Jump to search

Unified HQ9+, or alternatively, HQ9+++-*TCIX13BG2DidcoshwNZLEAR7U, is a language made by User:Cortex to unify all HQ9+ variants. It includes commands from just about every HQ9+ variant I could find, as well as some commands from other languages, and a few new commands unique to Unified HQ9+. Characters that are not commands are ignored.

Commands

Character What it does Language it's from
H Print "Hello, World!" HQ9+
Q Print the program's source code
9 Print the lyrics to 99 bottles of beer
+ Increment the accumulator
++ Create a new object and increment the accumulator twice. HQ9++
- Decrement the accumulator New to Unified HQ9+
* Double the accumulator New
T Change the instruction set to a Turing-complete superset HQ9+T (mentioned in CLB's HQ9+ blog post)
C Copy input to output CHIQRSX9+
I Interpret input as Unified HQ9+ code
X Make the language Turing-complete
1 Interpret all characters in the rest of the source code as their ROT13 variant.
3 Nop, for convenience. New
B Interpret input as a brainfuck program HQ9+B
G Print the interpreter's source code. (I is already taken, so I used G) HI9+
2 Increment the accumulator twice (for if you don't want to print ++'s explanation) New
D Make the language 2D, and add all commands from HQ9+2D New, but added to support HQ9+2D
i Increment the accumulator. If the accumulator is a character, set it the next ASCII character. Deadfish~
d Decrement the accumulator
c Make the accumulator a character
o Print the accumulator
s Square the accumulator
h End the program (it's necessary now, because of course it is)
w Print "Hello, world!"
N Increment the accumulator by 10 New
Z Set the accumulator to 0 (or to ASCII character 0 if the accumulator is a character)
L Blink LED (compilers and interpreters need not implement this command if they so choose) Embedded HQ9+
E Print a link to this very Esolangs article. Hexlr7
A Print the name of the programming language the interpreter was written in.
R Make the interpreter throw an error.
7 Do the following command 7 times. 77 followed by a command will do it 49 times. Any more than that and it just does it 7 times.
U Do whatever the creator of the interpreter wants this command to do New

Examples

Hello, World!

Hh

(prints "Hello, World!")

or

wh

(prints "Hello, world!")

or

NN*NNN2coZNs+oN---oo2+oZ2ss-N2oZ2ss-o-NN2+oN22o2+o------oZNsoZ2ss*+h

(prints "Hello, World!")

99 bottles of beer

9h

Quine

Qh

Cat program

Ch

Brainfuck interpreter

Bh

Self-interpreter

Ih

Hello, World! except it's 2D now for some reason

D        vh                     <

   v     H            <

   >                            ^
         >            ^

Hello World 2D, Part 2

Dv
>Hh
^<

External resources