1Hash

From Esolang
Jump to: navigation, search
The title of this article is incorrect because of technical limitations. The correct title is 1#.

1# is a 5 instruction register machine language.

Add 1 to Rn Add # to Rn Go forward n Go backward n Cases on Rn
1n# 1n## 1n### 1n#### 1n#####

Registers are processed as queues: first in, first out. All numbers are written in unary. The first two types of instructions add symbols to the right ends of the registers.

Case instructions pop symbols from the left ends. They work as follows:

  • If Rn is empty, we go to the very next instruction.
  • If the first symbol of Rn is 1, delete it and count down two instructions.
  • If the first symbol of Rn is #, delete it and count down three instructions.

Instructions are sequences of 1s and #s, and programs are sequences of instructions. In the interpreter, spaces inside of instructions don't count. You may enter each instruction on a line of its own, and you also may skip lines. Alternatively, a program may look like a long sequence of instructions run together.

When treating # as 0, each program is its own Gödel number.

Implementations are offered by the language designer in Java, as well as r5rs and r6rs scheme.

External resources

  • Paper (PDF) describing 1#