Number2D

From Esolang
Jump to navigation Jump to search

Number2D is esoteric programming language by User:ChuckEsoteric08 that uses ONLY numbers!

Commands

1 - if current direction is right, set direction down. If left, set direction up. If down, set direction right. If up, then direction is left
2 - if direction is right or down then set direction to left. If left or up, then right.
3 - flip bit and move pointer to the right
4 - move pointer to the left
5 - skip next instruction if bit is 0
6 - output next 8 bits as character
0 - Stop the program

If IP is outside program IP, then back from opposite direction

Examples

Example 1

1
41
 0

It will set direction to the down, set direction to left, then up. Because IP is outside of program, it back from down side, then program stops

Example 2

It is show how to make control progam flow

3510
  4
  3
  0

It is flip bit and move pointer to the right. Because Bit is zero it is not set direction to the down and stops program

Let's add '4' after '3'

34510
   4
   3
   0

It is flip bit and move pointer to the right. Then it set direction to the down, because current bit is not 0. It will move pointer to the left and flip it, then program stops.

H

Outputs "H"

334334333433433434444444460

Computational class

It is turing complete, because you can translate It to BitChanger, but with output

BitChanger Number2D
} 3
[ and ] Changing directions. Example of it above
< 4