We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

BubbleSort言語

From Esolang
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.

Commands
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

External Resources

https://github.com/lv100tomato/BubbleSortLanguage/