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.

Oddity

From Esolang
Jump to navigation Jump to search

Oddity is a queue-based esolang by User:ChuckEsoteric08.

Specification

The language uses an unbounded queue of integers, initially empty and has 6 commands:

  • 0 - enqueue 0
  • + - dequeue, increment and enqueue back
  • | - a loop, which dequeues and enqueues each element of a queue until a 0 is found, then it is discarded and loop stops
  • ( - dequeue and discard, if element was even (including 0) jumps to matching ). If there is no matching ) then it is unidentified behaviour
  • ) - NOP, only needed as a jump target for (
  • ; - splits code into two parts, with part after this character being in an infinite loop

Computational class

Oddity is Turing-complete as a version of Cyclic tag system without halting could be trivuially translated into it. First Data is initialized with 0 becoming 00|0+|+ and 1 becoming 00|+. Then it is followed by ;. Then each production is translated as being in (...) with 0 and 1 having same translations as in part when program is initialized. As such Cyclic tag program (011, 10, 101) with initial data 1 becomes:

00|+;(00|0+|+00|+00|+)(00|+00|0+|+)(00|+00|0+|+00|+)

It also does not use nested if statements, so it also proves that it is Turing-complete even with this restriction