Meander

From Esolang
Jump to: navigation, search

Meander is a minimalistic esolang with only four instructions, created by Brian McPherson in 2014.

Overview

Programs are treated by the interpreter as being in the form of a one-dimensional tape, but are conceptually equivalent to being in the form of a two-dimensional surface of a tube created by curling the tape to form a spiral with a circumference of 80 cells. For convenience, programs are displayed two-dimensionally as 80-column lines of ASCII text characters.

Pointers have both a position and an angle, with the value of the angle determining how far and in which direction each pointer moves when advanced, emulating movement on a two-dimensional plane.

The instruction pointer is initially placed at the start of the program, and the data pointer is initially placed at the first cell after the end of the program, with both pointers having an initial angle of zero degrees.

All undefined cells have an initial value of zero. There is no input or output, except through direct access to the content of the memory cells.

When loading the source-code, interpreters should ignore all non-command characters, white-space and newline codes. The program-area of the "tape" should contain no non-command characters when the program begins.

Commands

Instruction Meaning
 ! Rotate instruction pointer 45° clockwise
- Rotate data pointer 90° clockwise
+ Increment value in cell at data pointer and advance data pointer
 ? If value at data pointer is equal to 0 then rotate instruction pointer 90° clockwise, otherwise rotate instruction pointer 270° clockwise

Pointer Movement

Pointer Angle Pointer advances by
0 degrees +1 cells per move
45 degrees +81 cells per move
90 degrees +80 cells per move
135 degrees +79 cells per move
180 degrees -1 cells per move
225 degrees -81 cells per move
270 degrees -80 cells per move
315 degrees -79 cells per move

See also