ABCDirectionE

From Esolang
Jump to navigation Jump to search

ABCDirectionE is an esolang by User:BoundedBeans. It's identical to ABCDirection, but with an extra command allowing self-modifying. It also has the extra restriction that the code should be a power of two in size in both directions, or the E command will just act like B.

6 D's

The rule of having 6 consecutive D's to be included the last line in the program is still in effect, meaning that the program must always be at least 8 cells in width if you want to use the E command. The line with the D's counts as a line towards the power of two. The D's can also be modified out of the program, unlike with plain ABCDirection. This doesn't expand the field, since the D's are just a read-time construct.

The E command

Execute differently depending on the direction:

  • Right: Dequeue enough values within the queue to reach anywhere in the x axis bounds of the program in binary, do it again for the y axis, and increment the letter contained within, E becoming A.
  • Left: Do the same dequeue thing (don't modify the code), and then enqueue:
    • 1 if the cell is A
    • 11 if the cell is B
    • 111 if the cell is C
    • 1111 if the cell is D
    • 11111 if the cell is E
    • Note: If you want to tell which one it is, it's probably a good idea to enqueue a zero afterwards (you'll have to do that manually).
  • Up: Change direction based on the cell above.
    • A or B: Right
    • C or D: Left
    • E: Keep going up, then execute this same command. (So keep going up until the command is not E).
  • Down: Reset the board to its original state.