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.

Railhooking

From Esolang
Jump to navigation Jump to search

Railhooking is a version of User:Yayimhere's esolang Trainhooking made by User:ChuckEsoteric08 that is Turing-complete.

Description

Indexes of Railhooking commands start at 0. It has two unbounded signed registers initialized to 0, and all even-numbered instructions refer to first register and all odd-numbered to second register. It has one insturction and it has this form

+(b)[n/m]

It will add signed binary number b to the register and if result is a negative number it will jump to instruction n, if it is positive jump to m.

Computational class

Railhooking can be proved to be Turing-complete Minsky machines of this form could be translated into it:

INC Rx Lx - Increment register Rx and jump to Lx
DEC Rx Lx Ly - Decrement register Rx, if it became 0 jump to Lx, else it would jump to Ly

Into which Regular Minsky machine could be translated fairly trivially. It would be translated into Railhooking like that:

Start of a program - +(11)[1/1]+(11)[x/x]

In which x would be replaced by 2 if first instruction accesses first register and 3 if it accesses second register

  • If all jump targets would access first register then commands are translated like that:
INC R0 Lx - +(01)[Lx*2+2/Lx*2+2]+(nnn)[nnn]
INC R1 Lx - +(nnn)[nnn]+(01)[Lx*2+2/Lx*2+2]+(nnn)[nnn]
DEC R0 Lx Ly - +(11)[Lx*2+2/Ly*2+2]+(nnn)[nnn]
DEC R1 Lx Ly - +(nnn)[nnn]+(11)[Lx*2+2/Ly*2+2]

Where nnn could be any integer as it isn't executed. If jump target access second register then jump instruction's argument is increasd by 1.