Finder

From Esolang
Jump to navigation Jump to search

Finder is a Stack-based esolang created by User:ChuckEsoteric08 in which every program is a binary string.

Description

There is a single unbounded stack made out of unbounded values. Each loop has it's own index. Both the stack values and loop indexes are represented as x which is a string of 1's which length represents a number. There are only two commands:

  • 0x0 - push x to the stack
  • x0 - starts and ends loop with index x. Loop cycle is executed as follows:
    • Pop element from the top
    • Check if there are instances of those element in the stack.
    • If there are no instances then loop ends, if there are then topmost instance is removed and code inside the loop is executed.

Computational class

Finder is Turing-complete since it can easily implement Portable Minsky Machine Notation. Note that counter indexes in PMMN program should start at 3. a, b, c here represent the loop indexes that should be different each time they occur. Then commands are translated as follows:

inc(R):
 0R0
dec(R):
 0R0a0010a0
while(dec(R)) {
 ...
}
 0R0a0...0R0a0
if(dec(R)) {
 ABC
else {
 XYZ
}
 0100100R0a0b0010b0ABC010a0c0XYZ010c0