From Esolang
Jump to navigation Jump to search

8xn is an 1-dimensional esoteric programming language created by User:Infinitehexagon. It contains a special type of memory called a sequence.


All programs in 8xn usually start with a "8x", since it is the name of the esolang itself. Any program that starts with this x or this 8 or anything that isn't 8x will return an error.

The Sequence

The sequence stores data for the program. It starts off as 0000 and "slots" can be appended to it to make the sequence bigger. The sequence can append number literals as long and string literals. It has a memory pointer that always starts at 0 or the first character of the sequence. An example of a sequence is
^ in which ^ represents the memory pointer.
The latter can be also written like this:
Or this;
Or most commonly like this.

Let's say the memory pointer's value is 3. If the memory pointer's value is 3, then the slot it would be pointing to is D instead of C since the memory pointer's first value is considered 0, which would be A in this sequence. The sequence also loops back to 0 whenever the memory pointer goes over the length of the sequence.
Because the sequence starts off with numbers, the same sequence would look like this if not converted to ASCII.
65 66 67 68 69 70 71 72


Command Description
1 Increment the slot under the memory pointer by 1
2 Decrement the slot under the memory pointer by 1
3 shift the memory pointer to the right.
4 set the memory pointer's value to 0
5 get input and append it to the sequence.
6 output the current slot that the memory pointer.
7 reverse the entire sequence
8 Append a 0 to the sequence
9 Multiply the slot from the previous character in the sequence to the current slot in the sequence, store it into the current one, and clear the previous slot in the sequence.
0 delete the last value of the sequence
> Convert the slot at the memory pointer to an ASCII value
[ while not at the end of the sequence, jump to the "]".
] Jump back to the "[".
= If the current slot equals the next slot in the sequence, append 1 to the sequence and skip the next command but if not, append 0.

Example Programs

Hello world program


The output would be Hello, World! and the sequence would be 0H00d0!W0 .

Cat program


[0]5 deletes all the slots in the sequence, and then reads input
4[36] outputs all the characters



5= gets input and checks if it equals 0 and if so skip the "["
[6=] Since it still equals 0, output, then skip the close bracket and halt the program

XKCD Random Number


1111 increment by 4
6 output "4"

Infinite loop


Print the alphabet


111111113111111119 Multiply 8(8) and save 64 in slot #1
3119 Multiply 64(2) and save 128 in slot #2
222222222222222222222222222222222222224 Decrement slot #2 by 38 to get 90.
1111111131111111191 save 65 into slot #1.
>Convert slot #1 to "A".
3>Convert slot #2 to "Z".
[431=] Repeat going to slot #1, incrementing by 1, and check if slot #2 equals 90 and if so halt the program.
The output would be ABCDEFGHIJKLMNOPQRSTUVWXYZ and the sequence would be 0ZZ0.