IDIJ

From Esolang
Jump to navigation Jump to search

IDIJ (Increment Decrement If Jump) is an OISC by User:None1.

There is a tape with infinite cells and every cell is an unbounded signed integer.

The only command is:

A B C D

Increment address A then decrement address B, then if address C is 0, jump to line D (1-indexed).

Computational class

Turing complete, because you can easily compile it from minsky machine. Let's use 2-register minsky machine as an example:

Let N be current line number:

Increment register A:

0 2 0 N

Increment register B:

1 2 0 N

If register A is 0, jump to somewhere, otherwise decrement register A:

2 2 0 position
2 0 0 N

If register B is 0, jump to somewhere, otherwise decrement register B:

2 2 1 position
2 1 0 N

Translation for minsky machines with more than two registers can be made using similar techniques.