Back

From Esolang
Jump to navigation Jump to search

Back is a Fungeoid that can reflect back to the program when the program counter goes out of bounds.

Reflection

Take this program as an example:

\\
 *

It will eventually halt. These are the steps that Back takes:

  1. Move down a char
  2. Move down a char. This reaches the end of the program, so it maps back to the top of the line.
  3. Move right a char. This reflects the PC down a char, and then it reaches the end of the program.

As another example, this will also halt(which reflects 2 times):

//
 *

Syntax

The program counter starts at row 1, column 1, with the direction as right. It will stop when a * is encountered.

\ Reflect the direction down if the direction is right; Reflect the direction right if the direction is down. And vice versa.
/ Like \, but reversed. Reflect the direction down if the direction is left; Reflect the direction left if the direction is down. And vice versa.
< Move the bitwise tape head left a bit.
> Move the bitwise tape head right a bit.
- Flip the current bit.
+ Execute the next instruction if the current bit is nonzero.
* Halt the program.

Computational class

It can compile quite easily to Boolfuck without I/O.

+=-
<=<
>=>
[]=Conditionally switching the program flow; there is no exact translation
Example:
+\

Implementations

A Python interpreter by User:Bangyen.