Etcha

From Esolang
Jump to navigation Jump to search

Etcha is an esoteric programming language designed by Chris Pressey sometime in or around February of 2009. It is a variation on BitChanger, and it also has only four instructions. Instead of a tape, program state is stored in an unbounded 2-dimensional playfield of bits. Instead of a tape head, Etcha has a turtle which obeys three commands: move forward one cell, turn right 90 degrees, and toggle pen state (up or down). The pen is an "XOR pen" which, when down, toggles the state of a cell whenever the turtle leaves that cell. The initial state of the pen is down. Each time the turtle turns 360 degrees, i.e. every 4th time the command to turn right is executed, the pen state is toggled (from up to down or vice versa.)

Instructions

Command Mnemonic Effect
+ FD Move forward one cell
> RT Turn right 90 degrees
[ WHILE Same as in BitChanger
] WEND Same as in BitChanger

Example

The Etcha program

>+++>+++>+++>+++>[+]>>>>+

produces the following drawing:

#####
   # 
   # 
 ### 

Computational class

Etcha is Turing-complete because BitChanger is Turing-complete, and BitChanger programs can be trivially translated to Etcha programs. Start the Etcha program with >>>> to initially lift the pen. Then:

BitChanger   becomes     Etcha
    <                  >>>+>>>>>
    }                  >>>>>+>>>
    [                      [
    ]                      ]

See also

External resources