From Esolang
Jump to navigation Jump to search

This is a variant on Revaver created by User:Zzo38 in 2006.

There are an infinite numbers of stacks with integers on them, indexed by integers, one main stack, and one accumulator which can also store an integer.

The input is the data initially in all stacks and in the accumulator, the output is the final data of all stacks and the accumulator.

No stack is allowed to contain any number which is immediately followed by the same number.

In any empty stack the top value is considered to be zero, so you can't push zero to an empty stack, and popping an empty stack has no effect.

I believe programs without ! form a group.


  • 'a=b Returns -1 if a < b, 0 if a == b, 1 if a > b
  • 'a_b Subtract numbers
  • 'a.b NAND numbers
  • 'a' Absolute value of a
  • # Use value of accumulator
  • 'a$b Mingle a,b
  • 'a( Left-half unmingle of a
  • 'a) Right-half unmingle of a


Note that each command is the reverse of itself.

  • SWAM = Swap the accumulator with the top of the main stack, unless it is an empty stack or it would cause consecutive duplicates
  • SWMS n = Swap the main stack with the nth stack
  • PP n = Push n to the main stack, or pop if pushing would cause consecutive duplicates. (No effect if trying to push zero to an empty stack)
  • TEL n m = Search forward in the program (wraps around), continue execution at first found TEL where n evaluates to same value. m is a optional group number. Even though n is only considered for where to jump, a TEL command with an abstained group will do nothing, and a TEL command that is working will skip other TEL commands with abstained groups.
  • XOR n = XOR value at the top of the main stack with n unless it is empty or it would cause consecutive duplicates
  • IODE = Increment accumulator if odd, decrement if even
  • IEDO = Decrement accumulator if odd, increment if even
  • NEG = Negate the accumulator
  • SUB n = Set the top of the main stack to n minus the top of the main stack, unless empty or this would cause consecutive duplicates
  • CMS = Set the accumulator to the number of entries on main stack minus the value of the accumulator
  • TTG n = Toggle teleport group n
  • SUBS = Set the accumulator to the top of the main stack (zero if empty) minus the accumulator

There are a few extra commands that are not completely reversible because they do input/output:

  • !WT t = Write text and newline.
  • !WW t = Write text and space.
  • !WN n = Write number.
  • !WC n = Write character.
  • !TEST = Get program code from input.


You can write comments by typing / anywhere in a line.

Input/output notations

You can put a value of the accumulator, then values of stacks in square brackets (if not the main stack, put number and equals), then any abstained teleports by ! and group number. For example:

  • 5[1,0,2][3=4,-1]!-4!-1!17 means that accumulator=5, main stack is (bottom to top) 1,0,2 and stack number 3 is 4,-1 and abstaned teleports are numbers -4,-1,17

The interpreter expects input in this format and gives output in this format as well.

Applying a program (function) to a value is like doing f(x) (if the function is called f), and the reverse (as in tac f_forward > f_reverse) is f'(x).


Infinite loop program:

/ Infinite loop program. Start the accumulator at zero.
/ If the accumulator is non-zero, it will not infinite loop.
/ f(0)=InfiniteLoop
/ f(x)=x if x>0
/ f(x)=x+2 if x<0 and x is even
/ f(x)=x-2 if x<0 and x is odd
TEL '#=0

Countdown program:

/ Set the accumulator to an even number, and then it will put all numbers
/ onto stack n down to 2, counting by 2.
/ f(4)=0[4,2]!4
/ f(5)=InfiniteLoop
/ f(6)=0[6,4,2]!6
TEL '#=0 #
PP #
TEL 1 #

Reverse the order of the main stack:

/ Program to reverse the order of the stack.
/ Please initialize the accumulator to 0.
TEL # #
PP #
PP #
TEL # #

See also

  • Burro, which is also believed by its author to form a group

External resources