Nameless language

From Esolang
Jump to: navigation, search
Not to be confused with TLWNN.

The nameless language is an esoteric programming language which only uses the digits 1 and 0 in its source code, making it look like binary. It is based on brainfuck, but adds five additional commands, making it slightly easier for the programmer to perform common tasks.

Language overview

Nameless language operates on an array of memory cells called a tape. There is a virtual pointer which starts off pointing to the first memory cell. Each of nameless language's commands are four digits long and are only made up of ones and zeros. The commands are:

Command Description
0000 Move the pointer to the right
0001 Move the pointer to the left
0010 Increment the memory cell under the pointer
0011 Decrement the memory cell under the pointer
0100 Output the character signified by the cell at the pointer
0101 Input a character and store it in the cell at the pointer
0110 Jump past the matching 0111 if the cell under the pointer is 0
0111 Jump back to the matching 0110 if the cell under the pointer is nonzero
1000 Add the next command's base 10 equivalent to the current cell
1001 Subtract the next command's base 10 equivalent to the current cell
1010 Randomly sets the current cell's value to either 1 or 0
1011 Reset the current cell's value to 0
1100 Reset the pointer to point at cell 0

The nameless language interpreter ignores any characters which are not a one or a zero so you can type comments and they won't have any effect on the program. It is worth noting that the command 0001 which moves the pointer to the left, will wrap around to the last cell if it is called when the pointer is over the left most cell of the tape.

Example code

An example "hello, world" program written in nameless language:

10001010011000001000011100001000101000001000001100000010000100010001000100110111
00000010001001000000001001001000011101000100100000110100000000100010010000010001
100011110100000001001000001101001001011001001001100001000000

An example cat program which asks for five letters of input and then outputs them again:

0101000001010000010100000101000001011100010000000100000001000000010000000100

References