Praise Unto XHUL

From Esolang
Jump to navigation Jump to search

Praise Unto XHUL

Praise Unto XHUL is a language created by Th3BlackHole where all code must be written at run time due to the function names being completely random. The language is a stack based language where all inputs, outputs, and calculation are done through the stack. Also sometimes XHUL decides not to run your program, tough luck.

Syntax

Due to the unknown nature of the syntax in Praise Unto XHUL all the syntax will show the name of the function rather than it's token, and how it is used. Program level is determined by the number of spaces divided by four. So any code within an if statement would need four spaces in front to be counted as within the statement.

Function Name Arguments Purpose
Compare number 1, operation, number 2 Number 2 is not needed and will instead compare number 1 to the top of the stack
Character in (No arguments) Get a single character from the terminal
Character out (no arguments) Prints a single character to the terminal without a newline
Number in (no arguments) Gets a number from the terminal
Number out (no arguments) Prints a single number to the terminal
Addition number 1, number 2 if number 1 and number 2 are present adds them, if only number 1 is present, number 1 is added to the top of the stack, if no arguments are present adds the top two numbers of the stack. All inputs return to the top of the stack
Subtraction number 1, number 2 if number 1 and number 2 are then number 1 is subtracted by number 2, if only number 1 is present, the top of the stack is subtracted by number 1, if no arguments are present subtracts the top two numbers of the stack. All inputs return to the top of the stack
Multiplication number 1, number 2 if number 1 and number 2 are present multiplies them, if only number 1 is present, number 1 is multiplied by the top of the stack, if no arguments are present multiplies the top two numbers of the stack. All inputs return to the top of the stack
Division number 1, number 2 if number 1 and number 2 are then number 1 is divided by number 2, if only number 1 is present, the top of the stack is divided by number 1, if no arguments are present divides the top two numbers of the stack. All inputs return to the top of the stack
Modulo number1, number 2 if number 1 and number 2 are then number 1 is modulated by number 2, if only number 1 is present, the top of the stack is modulated by number 1, if no arguments are present modulates the top two numbers of the stack. All inputs return to the top of the stack
If statement number 1, operation, number 2 Executes a compare operation (same inputs) and if true executes the code within the block.
Else statement (no arguments) If and if statement did not execute and an else statement follows immediately after.
While loop (no arguments) Will execute endlessly unless a break command is used to exit the loop.
For loop number Loops for (number) times.
Break (no argument) Breaks out of a while loop.
Stack Copy (no argument) Copies the top number in the stack.
Stack Reverse (no argument) Reverses the stack.
Stack Add number, ... 20 Adds up to 20 values to the stack from left to right.

Examples

Examples will use the name of the function rather than any token, so to execute copy the code into a file and replace the function names with it's corresponding tokens

Hello World

 Stack Add 72 101 108 108 111 44 32 87 111 114 108 100 33
 Stack Reverse
 For loop 13
     Character Out