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.

Dubbelweal

From Esolang
Jump to navigation Jump to search

Dubbelweal is a two-dimensional turning tarpit by User:ChuckEsoteric08.

Description

The language works on a right-infinite tape which stores a single base-4 digit, from 0 to 3. It has two wheels, instruction wheel which is manipulated by the code and tape wheel which is manipulated by the instruction wheel. There are two types of commands: @ and everything else. If a character other than @ is executed it advances the instruction wheel once. If @ is executed it executes instruction on the instruction wheel. Instruction wheel has following commands:

  • turn - turn instruction pointer 45 degrees clockwise times equal to the value of a current cell (0 will not turn instruction pointer at all).
  • rot - rotates the Tape Wheel once.
  • exec - executes instruction at the tape wheel.

Tape wheel has following commands:

  • right - move tape pointer right.
  • left - move tape pointer left.
  • inc - increment current cell, wrapping around to 0 if it was 3.
  • out - output current cell's value as an integer
  • inp - input a single 4-bit digit into the current cell

As can be seen, it is fully reversible.

Computational class

Dubbelweal is Turing-complete as it can simulate 1-bit Reversible Brainfuck (translation from Quaternary Reversible Brainfuck would be much more difficult). Program consist of instructions translated as concatenated horizontal patterns.

  • > becomes:
--@--@@@@@--
  • < becomes:
-@-@--@@@@--
  • + becomes:
-@@-@--@@@---@@-@--@@@--
  • . becomes:
-@@@-@--@@--          
  • , (with 1 being encoded as 2) becomes:
-@@@@-@--@--
  • [ becomes:
---@@---
   ||
   ||   
  @++---
  @@@---
  • ] becomes:
---@---
   |
   |
---+@
---@@

For each new nesting depth gap between first and second lines should be increased by three.

See also