We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

3L

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

3L is an esolang by User:ChuckEsoteric08 which is a simplification of 2DChanger and with the name taken from 2L but refers to actual number of instructions in both itself and 2L

Specification

The program is on a two-dimensional grid with instruction pointer in top left corner and moving right. It uses binary tape infinite in both directions (unlike 2DChanger which uses right-infinite). It has three commands:

  • } - flip current cell and move tape pointer right
  • + - move tape pointer left. If current cell is 1, turn clockwise, else turn counter-clockwise
  • Everything else is a NOP but it is very important and thus counted as a seperate instruction

When running program backwards each command can be reversed, proving that it is reversible:

  • } - move tape pointer left and flip current cell
  • + - if current cell is 1 turn counter-clockwise, else turn clockwise. Regardless of the value move tape pointer right
  • NOP is it's own reverse

Examples

Simple Infinite loop

}++
 ++

It flips current cell and infinitely moves tape pointer to the left

Computational class

3L is Turing-complete as it can simulate Reversible Brainfuck with binary tape. Here is the translation method, which translates each instruction into horizontal pattern and uses 8 cells for each simulated RBF bit:

  • Program starts with:
}}}}+    
         
   + }}}}
   ++
  • + becomes:
         ++++
         +  +
}}}} }}}} ++ 
         +  +
         ++++
  • > becomes:
         ++++         
         +  +         
}}}} }}}} ++ }}}} }}}}
         +  +         
         ++++         
  • < becomes:
  ++++
  +  +
   ++
  +  +
  ++++
  • [abc] becomes:
         ++++         ++++             ++++         ++++        
         +  +         +  +             +  +         +  +
}}}} }}}} ++ }}}} }}}} ++ abc }}}} }}}} ++ }}}} }}}} ++ 
         +  +                          +  +             
         ++++                          ++++             
                      +                                +
                      ++                              ++
                                                    + +
                                                    ++
                        +                             +

For each nesting depth gap between fifth and sixth lines should increased by 5.