Omegaplex

Omegaplex, created by poiuy_qwert is a variant of the esoteric programming language Gammaplex created by Lode Vandevenne. It is definitely not as advanced as Lode Vandevenne's update to Gammaplex, Deltaplex, but is still an improvement in the opinion of the author. All the printable ASCII characters are used for commands.

Terminology
This just explains some things you will need to know if you are going to understand Omegaplex.


 * Stack : A 2-Dimensional floating point array(Stack[1024][1024]) which stores all the data in the program. Every entry is initialized to 0.
 * StackPointer : Which stack the program is currently using. Initialized to 1.
 * CurX, CurY : The X and Y positions in the program of the current command. Both initialized to 1.
 * Direction : The direction the program flow is headed: 1 = right, 2 = down, 3 = left, 4 = up. Initialized to 1 (right).
 * DecimalNumber, StringNumber : Dictates the behavior of the decimal and string systems explained below. Both initialized to 0.
 * Resolution : The screen resolution. Initialized to 255x255.
 * GraphicPointer : An array of intergers(GraphicPointer[6]) that point to stacks to be used in graphics, explained more below. Initialized to: 1 = 1, 2 = 2, ... 6 = 6.
 * String : Every number on the stack between until a number less than 0 or greater than 255 is considered an ASCII value to make a string.
 * FileByte : The current byte being pointed to in the file.
 * Pop : Takes the item off the top of the current stack, letting it be used for something or discarded.
 * Push : Puts a number on the top of the stack.
 * Get : Like pop, except that the item stays on the stack (a pop-then-push, or "peek").

Programs
Programs are text files having any extension (*.opx is the extension the author uses). The program starts in the top left corner of the text file (at 1,1), executes the command there, then moves into the direction specified by Direction onto the next command. Every line in the file should be of the exact same length in characters. If the program flow goes off the side of the file it will wrap around to the other side. For example:

\ \\ \Z

The program starts at the top left then:


 * 1) Does nothing, then
 * 2) Moves to the right, then turns (\), then
 * 3) Moves down, then turns (\), then
 * 4) Wraps to other end, then turns (\), then
 * 5) Goes down then, then turns (\), then
 * 6) Moves right, then the program ends (Z).

It can be modeled as such:

─┐ ┐└ └─

Commands
This is a list of all the commands: All characters on the keyboard except 9(horizontal indent, tab), 10(line feed, enter), and 13(carriage return, enter) are commands. Note: All commands are case sensitive!

Systems
These are some special systems designed to make Omegaplex esier to use.

Files
The Files system is used to interact with *.txt files in the same directory as the program. When you use the L command, if there is no file open it will take the string off the stack and open the file with that name, then push a 1. If there was a file open when the L command was used it closes the file the pushes a 0. When you open a file FileByte gets reset to 1, you can then increase or decrease it with a and A. The P command pushes the characters ASCII at FileByte, then increases FileByte then pushes 1 if its EOF or 0 if not. The z command writes the string on the stack to the file starting at the FileByte, increasing the FileByte every character.

Strings
The Strings system uses StringNumber which is a boolean variable initialized to 0. The " command is used to toggle StringNumber. When StringNumber is 1 every character read from the program is pushed as an ASCII value onto the current stack. If StringNumber is 0 the commads are executed regularily. There are also some commands that can be executed inside a string by prefixing them with a ~. The commands that can be used in a string are: /\{}; #

There are also special commands for strings, they are also prefixed with ~. They are: 2-9: Execute the next N characters as commands. ~:  Push the ASCII of ~.

Decimals
The Decimal system uses DecimalNumber which is anything from 2 to -2 that is initialized to 0 and can be changed with '.' and ','. Every command except the ones below reset the DecimalNumber to 0: 0123456789 .,/\{}

The commands 0-9 do the following:

Math
The M command executes a math function depending on pop. Depending on the function up to the next 2 stack values can be poped as u and v. The functions are:
 * 1) sin(u): sine
 * 2) cos(u): cosine
 * 3) tan(u): tangent
 * 4) sec(u): secant
 * 5) csc(u): cosecant
 * 6) cot(u): cotangent
 * 7) asin(u): inverse sine
 * 8) acos(u): inverse cosine
 * 9) atan(u): inverse tangent
 * 10) asec(u): inverse secant
 * 11) acsc(u): inverse cosecant
 * 12) acot(u): inverse cotangent
 * 13) sinh(u): hyperbolic sine
 * 14) cosh(u): hyperbolic cosine
 * 15) tanh(u): hyperbolic tangent
 * 16) sech(u): hyperbolic secant
 * 17) csch(u): hyperbolic cosecant
 * 18) coth(u): hyperbolic cotangent
 * 19) asinh(u): inverse hyperbolic sine
 * 20) acosh(u): inverse hyperbolic cosine
 * 21) atanh(u): inverse hyperbolic tangent
 * 22) asech(u): inverse hyperbolic secant
 * 23) acsch(u): inverse hyperbolic cosecant
 * 24) acoth(u): inverse hyperbolic cotangent
 * 25) exp(u): exponential: e^u
 * 26) ln(u): natural logarithm (base e)
 * 27) exp(-(u * u)): standard normal distribution
 * 28) sign(u): returns -1, 0 or 1 (the sign of u)
 * 29) atan2(v, u): computes the principal value of the arc tangent of v/u, using the signs of both arguments to determine the quadrant of the return value
 * 30) log_u(v): base u logarithm of v, that is: ln(v)/ln(u)

Graphics
When using the commands p, l, c, and b to draw, you need to have coordinates and colors for them. To make things easier for graphics, you must set the GraphicPointers to a Stack where you will define everything for the graphics. Setting a GraphicPointer is done with the x command. The x command pops a number from the stack to choose which setting to change, and those settings are:
 * 1) Coordinates A (Top value is x, 2nd value is y)
 * 2) Coordinates B (Top value is x, 2nd value is y)
 * 3) Color A (Top value is r, 2nd value is g, 3rd value is b)
 * 4) Color B (Top value is r, 2nd value is g, 3rd value is b)
 * 5) Radius
 * 6) Transparency (1-256, 1 being opaque, 256 being transparent)

There are also graphic styles that can be toggled with the f command. The f command also pops a number from the stack to choose which style to toggle. The styles are:
 * 1) Enable transparency
 * 2) Multiply blending
 * 3) Make underlying pixels negative color (effect visible if transparency or blending is used)
 * 4) Do not draw over pixels with Color B
 * 5) Only draw over pixels with Color B
 * 6) 50% dot pattern
 * 7) Less dots than above
 * 8) Horizontal lines
 * 9) Vertical lines
 * 10) Invert pattern (transparent pixels are now filled ones and vice versa)
 * 11) Horizontal gradient
 * 12) Vertical gradient
 * 13) Text background as Color B (with gradient the background is opposite gradient of text)

4 and 5 together form "draw with (Color A + Color B)/2 over Color B, draw normally over the rest"

Horizontal and vertical gradient together make 45Рgradient. The gradient is from one side of the screen to the other side, and uses Color A and Color B. 4 and 5 are disabled when gradient is enabled.

Dot and stripe patterns mixed form dotted line patterns (the combination of all removed pixels).

Implementation
The author of Omegaplex has asked and was allowed by Lode Vandevenne to use the Gammaplex interpreter source as a base for the Omegaplex interpreter. This means the creation of the interpreter will go fast.

Example Programs
These programs work in theory, but since the language is unimplemented there is no way to know if they do.

Hello World!
Outputs "Hello, World!" to the screen. "Hello, World!"~OZ

Omegaplex Demo
The Gammaplex demo edited to work in Omegaplex. "Omegaplex"~>0y'>'yy>\ /       f21xy4xy3xy2/ {t650:2M124*124+t4\ \C@O`s1+29*29M2:00}