BRUH
Four capital letters. Three of them spell the commands, the fourth keeps them apart, and two of it start a comment.
2022 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
BRUH dates from 2022. It is a brainfuck relative written in the letters of its name. Every command is three letters from B, R and U, and an H goes between commands. Everything that is not one of the four capitals is a comment, and so is text between HH and HH. The program ends with RHHB.
Read the story
Memory is a row of accumulators instead of a tape. There is only one at the start, and the program has to add more on either side before it can move.
The machine
| Command | Does |
|---|---|
BBB BBR | Add 1, take 1 |
BBU | Square the accumulator |
BUR BUU | Add an accumulator at the left or right end of the row |
RBR RBU | Move one accumulator right or left |
UUU URU | brainfuck's [ and ] |
UBR | Do the command before it as many times as the accumulator says |
RRB | Read a number |
RRU RBB | Print the accumulator as a character or as a number |
HHH starts a comment over many lines. Numbers print as bare digits, and the end of the input reads as 0.
Example
The adder, with its comments.
The adder, with its comments. It adds a second accumulator, reads one number into each, then moves 1 from the left to the right until the left one is 0.
The truth machine. On 0 the loop is skipped and the last RBB prints 0. On 1 the loop prints 1 forever.
UBR repeats. Three BBB make 3, and UBR does BBB three more times.
Patterns it teaches
- Turing tarpit: brainfuck's loop with a row of counters.
- Encoding tricks: thirteen commands spelled in three letters.
Further
- esolangs.org/wiki/BRUH
- brainfuck, whose loop it borrows.
See also
Also in Turing tarpits
Write your own in Run Convert a program from BRUH
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: bruh.
Command line
shib run bruh -e 'RRBHUUUHRBBHURUHRBBHRHHB' --input '0'shib manual bruhSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/bruh.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org