BubbleSort言語
Jump to navigation
Jump to search
BubbleSort言語, also known as BubbleSortLang is an esoteric programming language by lv100tomato. A brainfuck derivative with two pointers based on Wikipedia:bubble sort.
Specification
Program is a list of nonnegative integers delimited by a newline.
When the two values y, x are swapped through the sorting process, result of (x+y)%50
is consider to be a program command.
Value | Command |
---|---|
0-3 | ptrA++, ptrB++, ptrA--, ptrB-- |
4-7 | mem[ptrA]++ / mem[ptrB]++ / ... |
8,9 | putchar(mem[ptrA]) / ... |
10,11 | mem[ptrA] = getchar() / ... |
12,13 | For smaller Index (0-indexed),
Source[Index+mem[ptrA]] += mem[ptrB] ; Or Source[Index+mem[ptrA]] -= mem[ptrB |
14,15 | if mem[ptrA] == 0 then increment or decrement ptrB |
>15 | no operation |