Eso2D

From Esolang
Jump to navigation Jump to search

Eso2D is a 2D esoteric language made by User:PythonshellDebugwindow.

Memory

Eso2D uses a wrapping 8-bit accumulator, therefore it has limited memory and is Turing-incomplete.

Instruction pointer

Eso2D’s IP can move in 4 directions—0 (up), 1 (right), 2 (down), and 3 (left). It starts out in the top-left corner of the program moving right, and if it ever goes out of bounds, it wraps around, so

v
>>

would start the IP at the top-left, turn it down, and then move it right forever because it keeps wrapping on the second row.

Auto-formatting

Before execution, the Eso2D interpreter finds the longest row and pads all rows to that row’s length, and the same goes for columns.

Commands

Command Meaning
^ Set the IP’s direction to 0 (up)
> Set the IP’s direction to 1 (right)
v Set the IP’s direction to 2 (down)
< Set the IP’s direction to 3 (left)
, Increment the accumulator
_ Decrement the accumulator
X Reverse the accumulator’s direction
~ If the IP encounters this command while moving up, it will change direction to down; down, to up; and left or right, if the accumulator is less than 85, it will move up, or if the accumulator is greater than 170, it will move down.
` If the accumulator is 0, the IP will change direction to down, else nothing will happen; does nothing if the IP is moving down when it encounters this command
& Sets the accumulator to the Unicode value of the first character of user input % 256 (or 10 if no input is given)
# Output the (extended) ASCII character of the accumulator’s value
* Output the accumulator’s value followed by a space
@ Exit the program (without raising an error)
0 Increment the accumulator by 5
1 Increment the accumulator by 50
2 Increment the accumulator by 97
3 Decrement the accumulator by 200
4 Decrement the accumulator by 5
5 Decrement the accumulator by 50
= If the accumulator is greater than 0, skip the next instruction
O Skip the next instruction no matter what
? Randomize the IP’s direction to either up, right, down, or left
(space) Nop
(newline) Separates lines in the source code, making the language 2D

All other characters, when encountered by the IP, will cause the program to error and exit.

Example programs

Loop while input = “”

>&44`@
^   <

The above, but a one-liner

&44=O@

Handy subprograms

You can include these anywhere in your program. The place where the IP goes in is marked with a bold, underlined arrow (^>v<) and where it comes out is marked with an italicized, underlined arrow.

Set the accumulator to 0

v  <
>`_^
 v

You don’t need to include the exiting v, but you do need to include the entering >.

Resources

  • An interpreter written in Python, along with some examples