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. There is a method to do Reversible Brainfuck-style loops:

abc[def]ghi

Becomes:

  @@@@   @@@@
  @  @   @  @
abc@@ def @@ ghi
  @         @
  @@       @@
    @     @

Where it starts and ends while moving right. It has the same problem as similar languages like 2L and 3L of executing arbitrary effect at an arbitrary point but is possible to do so.

Implementations

2-ill is implemented in yoob.

See also