Post-Unified HQ9+

From Esolang
Jump to navigation Jump to search

Post-Unified HQ9+, or alternatively, HQ9+++-*TCIX13BG2DidcoshwNZLEAR7UJ<>_()[]{}0.,&~:#, is a language made by User:Orisphera to extend Unified HQ9+, a language made by User:Cortex to unify all HQ9+ variants. It includes all the commands from Unified HQ9+, which are 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+", and adds some more. Characters that are not commands are ignored.

Commands

Character What it does What _ does after it Language it's from
H Print "Hello, World!" Raise an I/O exception HQ9+
Q Print the program's source code Do what _ after Q does
9 Print the lyrics to 99 bottles of beer Infinite loop
+ Increment the accumulator Divide 1 by 0
++ Create a new object and increment the accumulator twice. Raise a virtual exception HQ9++
- Decrement the accumulator Divide 0 by 0 Unified HQ9+
* Double the accumulator Raise 0 to the power 0 Unified HQ9+
T Change the instruction set from the Unified HQ9+ instruction set (like INTERCAL's COME FROM) Syntax error Changed in Post-Unified HQ9+
C Copy input to output Output EOF CHIQRSX9+
I Interpret input as Post-Unified HQ9+ code Whatever it does after the last processed character of input other than the h (or, if the h is the first one, what's before the I)
X Make the language Turing-complete Undefined
1 Interpret all characters in the rest of the source code as their ROT13 variant. Import "this" (whatever it is in the language the interpreter is in)
3 Nop, for convenience. Nop Unified HQ9+
B Interpret input as a brainfuck program Retroactively changes the input to []+[] HQ9+B
G Print the interpreter's source code. (I is already taken, so Cortex used G) Changes the output of the G to run the program it's in instead of getting it from file or wherever it does HI9+
2 Increment the accumulator twice (for if you don't want to print ++'s explanation) Divide 2 by 0 Unified HQ9+
D Make the language 2D, and add all commands from HQ9+2D Do what the command that sets the direction to the current one does when in 1D mode Unified HQ9+, but added to support HQ9+2D
i Increment the accumulator. If the accumulator is a character, set it the next ASCII character. Compute ln(0) Deadfish~
d Decrement the accumulator Compute ln(-1)
c Make the accumulator a character Make it a number again
o Print the accumulator Undefined
s Square the accumulator Compute sqrt(-1)
h End the program (it's necessary now, because of course it is) Solve the halting problem
w Print "Hello, world!" Raise an I/O error
N Increment the accumulator by 10 Divide 10 by 0 New
Z Set the accumulator to 0 (or to ASCII character 0 if the accumulator is a character) Divide the accumulator by itself
L Blink LED (compilers and interpreters need not implement this command if they so choose) Form a digraph (L_) that makes a long blink Embedded HQ9+
E Print a link to this very Esolangs article. Print a rickroll link instead Hexlr7
A Print the name of the programming language the interpreter was written in. Print the language the program is written in instead
R Make the interpreter throw an error. Get input and find the shortest program to output it
7 Do the following command 7 times. 77 followed by a command will do it 49 times. Increase an internal value that is initially Sunday by 1 day
U Do whatever the creator of the interpreter wants this command to do Do whatever the creator of the interpreter wants this to do New
J Print the lyrics to 99 jars of jam Overcomplicated infinite loop Not in Unified HQ9+; (){} are from Deadfish~, and the rest are from an unpublished HQ9+ extension
< Push the accumulator onto a stack and try to pop a value from another stack and set the accumulator to the popped value or 0 if the popping failed Access an out-of-bounds element of a vector or list depending on the language the interpreter is in
> Same as < except with the stacks swapped Access a non-existent value in a map or dict depending on the language the interpreter is in
_ See the third column for the previous command Move the instruction pointer left 1 space
(...) Only do this if the accumulator isn't 0 Do whatever the last executed command does because the brackets themselves don't change the last command register; the code inside does.
[...] Do this while the accumulator isn't 0
{...} Instructions inside are repeated 10 times
0 Make the accumulator 0 (or '\0' if it's a character) End the program
. Output the accumulator as character without newline or space after it Output a whitespace
, Input the accumulator as character, like cin.get() in C++ Skip whitespaces
& Output the accumulator as number Output a newline
~ Input the accumulator as number Skip whitespaces
: Same as . if the accumulator isn't 0 and , otherwise Same as after . or ,
# Same as & if the accumulator isn't 0 and ~ otherwise Same as after & or ~

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
^<

Output SOS with LED

 LLLL_L_L_LLL