BRUH

From Esolang
Jump to navigation Jump to search

BRUH is an esoteric programming language that only uses the letters B, R, U, and H for its 3 letter commands, with B, R, and U for commands and H for separating the commands. Everything that isn't a capital B, R, U, or H is considered a comment, comments can also be determined with HH as the ends, and HHH for a multiline comment. Also, the file extension, although the contents are regular text, must be .bruh for the interpreter to allow it to work

Commands

To make a command, you have to fuse a combo of B, R, and U in one of the following combos.

Commands
Command Equivalent Function
BBB + from brainfuck Add 1 to the accumulator
BBR - from brainfuck Subtract 1 from accumulator
BBU s from Deadfish Square accumulator
BUR [NONE] Add another accumulator to the left
BUU [NONE] Add another accumulator to the right
RBR > from brainfuck Move to accumulator on the right
RBU < from brainfuck Move to accumulator on the left
UUU [ from brainfuck Skip everything to the next URU if accumulator is zero
URU ] from brainfuck Jump back to the last UUU if accumulator is not zero
UBR [NONE] Do the previous command the amount of times in the accumulator
RRB Input Input Number
RRU Output Output as ASCII char
RBB Output Output as a number

To end a program, use RHHB

Examples of usage

Adder

HH Add an accumulator HH
BUUH
HH Input HH
RRBHRBRHRRBHRBUH
HH Adding HH
UUUH
BBRHRBRHBBBHRBUH
URUH
HH Output HH
RBRHRBBHRHHB

Truth machine

From here on, nothing is color coded to show how painful it can get trying to see where, just imagine the H's didn't exist!

RRBHUUUHRBBHURUHRBBHRHHB

Cat program

The following code implements a numeric cat program which repeats until an input of zero is committed:

RRBH
RBBH
UUUH
RRBH
RBBH
URUH
RHHB

Interpreter

  • Common Lisp implementation of the BRUH programming language.