esolang

Eso2D

A fungeoid that wraps at every edge, steering one pointer along a tape of bytes.

PythonshellDebugwindow, 2020 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hello, World!

The idea

PythonshellDebugwindow made Eso2D in 2020. The program is a grid, and the instruction pointer starts in the top-left corner going right. Leaving the grid on one side brings it back on the other. Memory is a tape of bytes that runs right from cell 0, and the cell under the cell pointer is the accumulator.

Read the story

There are no number literals. Six digits each add a fixed amount, 5, 50 or 97, or take away 200, 5 or 50, so every value is built as a sum.

The machine

CommandDoes
^ > v <Point the pointer up, right, down or left
XTurn it round
` | Turn down if the accumulator is 0
~Up becomes down and down up; going sideways, turn up below 85 and down above 170
= OSkip the next cell if the accumulator is above 0, or always
?Point at random
, _Add 1, take 1
0 1 2Add 5, 50 or 97
3 4 5Take 200, 5 or 50
} {Move the cell pointer right or left
& $ :Read a line as a character, as a number, or into the tape from the accumulator on
# *Print the accumulator as a character, or as a number and a space
@End

A space does nothing, and any other character stops the program with an error. So does moving left of cell 0.

Example

The Hello, World! is one row of sums.

The Hello, World! is one row of sums. 50, four 5s and two 1s make 72, the code of H.

The cat reads the whole line into the tape with :. The loop prints a cell, moves right and goes round by v, <, ^ and >. After the last character the cell is 0, and the backtick turns the pointer down onto @.

Expected: ABC

The truth machine reads a number. On 0 the backtick sends the pointer down to the >, which leads through * to @. On 1 it bounces between v and ^ through * forever.

Expected: 0

The specification also has a 99 bottles of beer on 28 rows. It runs to the end of the song in 234,403 steps.

Patterns it teaches

Further

Two-dimensional languages

Cell-based

Write your own in Run Convert a program from Eso2D

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: eso2d.

Command line

shib run eso2d -e '$`v
 >*@
  ^' --input '0'
shib manual eso2d

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/eso2d.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org