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.

2-ill

From Esolang
Jump to navigation Jump to search

2-ill is designed by User:Zzo38, to be something like 2L but a bit different.

The memory is a tape (similar to Brainfuck) infinite on both directions and starts all zero, each cell can be only value 0 or 1, no other values are possible.

The commands are:

  • $ indicates start position of program, going east. If hit, it has no effect.
  • @ turns program pointer clockwise if value at pointer is 1, or counter-clockwise if is 0.
  • # has different effects depending on direction of program pointer:
    • North = output bit at tape pointer, skip 2 program cells
    • South = input bit, store at tape pointer, skip 2 program cells
    • West = move tape pointer 1 space backwards, skip 2 program cells
    • East = toggle bit at tape pointer and then move tape pointer 1 space forwards, skip 2 program cells
  • Anything else does nothing and can be used for comments.

Program stops when program pointer falls off the edge of the world.

Examples

A bitwise cat program which records the inverse of each bit along the tape:

'------'
'@  @ @'
'   @@ '
'@#$ @ '
'   #  '
'      '
'  @ @ '
'  @@@ '
'@    @'
'------'

A plain old bitwise cat program:

@@@
@$@
 | 
 # 
 | 
@?@
@@@

Writes alternating 0's and 1's to the tape:

@       @

   @#   @
   @   #@
    @@
@$#  @
    @#  @

Idiom for ending up on a known cell (one left of the current cell, at label A) after writing an unknown value to the current cell:

      @@
     $ @
      #

       @@
A  #@#@ @
   @    @
   @@  @@

Computational class

2-ill is Turing-complete as it can simulate 1-bit Reversible Brainfuck. Here is the translation method:

  • + becomes:
 @      @
 @  #@@@
 @     @
>#  @@@  >
      @ @
  • > becomes:
 @      @   @      @
 @  #@@@    @  #@@@
 @     @    @     @
>#  @@@  #  #  @@@  >
      @ @        @ @
  • < becomes:
 @      @ @         @
 @  #@@@  @  #  #@@@
 @     @  @        @
>#  @@@  #    #  @@  >
      @ @         @ @
  • abc[def]ghi Becomes:
   @@@@   @@@@
   @  @   @  @
>abc@@ def @@ ghi>
                 
   @         @
   @@       @@
     @     @

For each new depth a gap between third and fourth lines should be increased by three.

> in 2-illl code signifies entry and exit points of each translated block.

Implementations

2-ill is implemented in yoob.

See also