Unvague

From Esolang
Jump to navigation Jump to search
'''Unvague''' is an esolang designed by [[User:JHSHernandez-ZBH]] based on [[Vague]] and is completely compatible with it but with a few special commands.

First, a stack is pushed on the stack stack, the input is taken as a binary number, the number seperated into bits, and the bits are seperately pushed onto the stack.

Next, when the command A is executed, all following commands will be in this instruction set:

{| class="wikitable"
|-
! Command !! Action
|-
| <code>+</code> || Pushes the sum of the top two numbers on the stack.
|-
| <code>-</code> || Pushes the top of the stack minus 1.
|-
| <code>!</code> || Prints the top of the stack as a number.
|-
| <code>></code> || Changes the direction to right if 1 was last executed and down if 2 was last executed.
|-
| <code><</code> || Changes the direction to left if 1 was last executed and up if 2 was last executed.
|-
| <code>&</code> || Pushes the top of stack mod 2 NAND the second on stack mod 2.
|-
| <code>=</code> || Duplicates the top value on the stack.
|-
| <code>_</code> || Pops the top value from the stack.
|-
| <code>.</code> || Halts immaturely.
|-
| <code>0</code> || Empties the stack and pushes 0.
|-
| <code>*</code> || Pops two values from the stack, multiplies them, and pushes the result modulo 2.
|-
| <code>2</code> || (see <code>></code> and <code><</code>)
|-
| <code>1</code> || (see <code>></code> and <code><</code>)
|-
| <code>t</code> || Pushes 1 to the stack.
|-
| <code>f</code> || Pushes 0 to the stack.
|-
| <code>(</code> || Does nothing.
|-
| <code>)</code> || Does nothing.
|}

Next, when the command I is executed, all following commands will be in this instruction set:

{| class="wikitable"
|-
! Command !! Action
|-
| <code>+</code> || Appends the current line of code to the current line of code.
|-
| <code>-</code> || Appends the previous instruction executed to the end of the current line of code.
|-
| <code>!</code> || Prints the current line of code as a string.
|-
| <code>></code> || Skips the next instruction.
|-
| <code><</code> || Halts immaturely.
|-
| <code>&</code> || Replaces the current line of code with the utf-8 decoded version of the utf-8 encoded version of the current line of code NAND the utf-16 encoded version of the current line of code.
|-
| <code>=</code> || Repeats the last instruction executed.
|-
| <code>_</code> || Skips the next instruction.
|-
| <code>.</code> || Halts immaturely.
|-
| <code>0</code> || Halts immaturely.
|-
| <code>*</code> || Halts immaturely.
|-
| <code>2</code> || Turns the direction of code right.
|-
| <code>1</code> || Reverses the direction of code.
|-
| <code>t</code> || Appends 1 to the current line of code.
|-
| <code>f</code> || Appends 0 to the current line of code.
|-
| <code>(</code> || Jumps to the start of the line of code.
|-
| <code>)</code> || Halts immaturely.
|}

Next, when the command O is executed, all following commands print themselves, except for <code>f</code>, which pushes 0 to the stack. (This is the default behavior.)

Next, when the command V is executed, all following commands will be in this instruction set:

{| class="wikitable"
|-
! Command !! Action
|-
| <code>+</code> || Pushes the sum of the top two values on the stack.
|-
| <code>-</code> || Decrements the value on top of the stack.
|-
| <code>!</code> || Prints the top of the stack as a character.
|-
| <code>></code> || Changes the direction to right.
|-
| <code><</code> || Changes the direction to left.
|-
| <code>^</code> || Changes the direction to up.
|-
| <code>v</code> || Changes the direction to down.
|-
| <code>&</code> || Pushes the top of stack mod 2 NAND the top of stack mod 2.
|-
| <code>=</code> || Pushes the next character onto the stack.
|-
| <code>_</code> || Pops an item off the stack.
|-
| <code>.</code> || Halts immaturely.
|-
| <code>0</code> || Pushes 0 onto the stack.
|-
| <code>*</code> || Pops the top 2 values off the stack, and moves the pointer to that address.
|-
| <code>2</code> || Allow usage of <code>^</code> and <code>v</code>.
|-
| <code>1</code> || Disallow usage of <code>^</code> and <code>v</code>.
|-
| <code>t</code> || Pushes 1 onto the stack.
|-
| <code>f</code> || Pushes 0 to the stack.
|-
| <code>(</code> || Does nothing.
|-
| <code>)</code> || Does nothing.
|}

Next, when the command J is executed, all following commands will be in this instruction set:

{| class="wikitable"
|-
! Command !! Action
|-
| <code>+</code> || Pops the top of the stack and adds it to the register if 1 was last executed and adds the top of the popped stack to the register if 2 was last executed.
|-
| <code>-</code> || Decrements the register.
|-
| <code>!</code> || Prints the register as a character.
|-
| <code>></code> || Moves the bottom value to the top if 1 was last executed and the bottom stack to the top if 2 was last executed.
|-
| <code><</code> || Moves the top value to the bottom if 1 was last executed and the top stack to the bottom if 2 was last executed.
|-
| <code>&</code> || Pops the top of the stack and NANDs the register with it if 1 was last executed and NANDS the value on the register with the top of the popped stack if 2 was last executed.
|-
| <code>=</code> || Pushes the value of the register onto the stack if 1 was last executed and pushes an empty stack if 2 was last executed.
|-
| <code>_</code> || Pops a number off the stack and stores it into the the register if 1 was last executed and pops the top stack if 2 was last executed.
|-
| <code>.</code> || Halts immaturely.
|-
| <code>0</code> || Set the accumulator to zero.
|-
| <code>*</code> || Randomizes the color, intensity, blinkage, italic, underline, and background of the next character.
|-
| <code>2</code> || (see <code>+</code>, <code>></code>, <code><</code>, <code>=</code>, <code>_</code>)
|-
| <code>1</code> || (see <code>+</code>, <code>></code>, <code><</code>, <code>=</code>, <code>_</code>)
|-
| <code>t</code> || Pushes 1 onto the stack.
|-
| <code>f</code> || Pushes 0 to the stack.
|-
| <code>(</code> || Does nothing.
|-
| <code>)</code> || Jumps to the matching <code>(</code> if the top of the stack is not zero.
|}

Lastly, if you encounter any of the instructions that "halt immaturely", the stack is read, and the read data is printed as a character.

[[Category:Languages]] [[Category:Unimplemented]] [[Category:Turing complete]]