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.

2DChanger

From Esolang
Jump to navigation Jump to search

2DChanger is BitChanger, except it is two-dimensional.

Commands

Command Meaning
} flip bit and move bit pointer to the right
< move bit pointer to the left
+ if current bit is not zero, move instruction pointer (IP) clockwise, else counter-clockwise

Reversibility

Each of three commands, when moving backwards can be reversed:

Command Meaning
} move bit pointer to the left and flip bit
< move bit pointer to the right
+ if current bit is not zero, move instruction pointer (IP) counter-clockwise, else clockwise

Thus meaning that the language is reversible

Examples

Hello, World!

The following program replicates the bits corresponding to the ASCII codes contained in the text “Hello, World!” in the memory. Each character is represented by eight bits, from most significant to the least significant position. Please note that a single zero-bit is appended to the memory as a consequence of the necessity to move the cell pointer during the bit setting process. Each row of the program serves to encode one character from the message.

 }<}}}<}}<}}}<}}<}}<}    }<+
+}}<}}}<}}<}}}}<}        <}+
+}<}}}}<}}}}<}}<}        }<+
+}<}}<}}}}<}}}}<}        <}+
+}<}}}}<}}}}}            }<+
+}<}}<}}}}<}}}<}}<}      <}+
+}<}}<}}}<}}<}}<}}<}}<}  }<+
+}}}}<}}}<}}}<}          <}+
+}<}}}}<}}}}}            }<+
+}<}}}<}}<}}}}}<}        <}+
+}<}}}}<}}}}<}}<}        }<+
+}<}}<}}}<}}<}}}}<}      <}+
+}<}}<}}}<}}<}}<}}<}}       

Interpreter

  • Common Lisp implementation of the 2DChanger programming language. The program also includes a text program generator which produces the 2DChanger source code capable of replicating a string's ASCII codes in the memory in binary form.