EGL

From Esolang
Jump to navigation Jump to search

EGL (Esoteric Gridding Language) is a two-dimensional fungeoid esoteric programming language designed by User:Sato.

Commands

Cmd Meaning
, Separates dimension values
: Begins the program
> Go right
< Go left
^ Go up
v Go down
_ Reflect position over x
| Reflect position over y
% Reflect position over origin
x Input
+ Increment
- Decrement
( Start loop
) End loop
= Output value
# Output grid

Structure

An EGL script begins with the grid's dimension settings, which are in the format x,y.

Example: 10,10 will set the grid dimensions to 10 by 10.

After the dimensions are set the program begins with a colon.

Example: 10,10: will produce an empty grid with 10 boxes along the x axis and 10 boxes along the y axis.

Transport operators are utilized in order to traverse throughout the grid. They are >, ^, <, v, _, |, and %.

Example: 10,10:v>>_ will set the current position to row 9, column 3.

Arithmetic operators are utilized in order to manipulate an element's value.

Example: 10,10:v>>_++ will set the element at row 9, column 3 equal to 2.

Communication operators are utilized in order to interact with the client.

Example: 10,10:v>>_++= will output 2.
Example: 10,10:v>>_x will set the element at row 9, column 3 equal to a user defined value.
Example: 10,10:v>>_++# will output the following grid:
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|0|0|0|0|0|0|0|0|
|0|0|2|0|0|0|0|0|0|0|

Loops begin with an open parenthesis, (, and end with a close parenthesis, ). The code within the parentheses will continue to be executed until the element that the loop was declared on is equal to 0.

Example: 10,1:++(>+++++<-) will set the element at 2,1 equal to 10.

External resources