L00P

From Esolang
Jump to: navigation, search

L00P is a Brainfuck-derived programming language designed by Georg Westenberger. Its name comes from the fact that every program is enclosed within an implicit loop.

Data are stored within cells of a circular memory array; the number of cells is implementation-defined (8192 in the reference implementation). Each cell is a 16-bit signed integer initialized to 0.

Instructions

The language retains Brainfuck's commands except for [ and ]. Additionally, the following commands are provided:

; Input at current cell in decimal notation
: Output from current cell in decimal notation
0 Set the current cell to 0
* Multiply the current cell by 2
_ Multiply the current cell by -1
# Move n cells to the right where n is the value in the current cell
@ Set the current cell to the value of the cell you would reach with a # command
$ Set the cell you would reach with a # command to the value of the current cell
& Terminate the program
S Set the current cell to the sign of the current cell's present value

There is also a single control structure ( | ). If the value of the current cell is nonzero, the commands between ( and | are executed; otherwise, the commands between | and ) are executed. The | is optional, and if it is omitted, the cell being zero will result in none of the parenthesized actions taken place. This structure can also be written with square brackets as [ | ].

External resources