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.

BF instruction extension

From Esolang
Jump to navigation Jump to search

Our goal is to extend the instructions of Brainf*ck as far as possible. Anything that you thought of could be one of the instructions. We'll start with the standard commands:

+-><[],.

Then add commands to set the cell to zero, and loops that only loop if the cell is zero:

=()

Then use base-36 to set the cell to that value:

1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ

Then use more base-36 to set the cell to 1 if it's equal to that value, else set to 0:

$§¥€¢£₩«»•abcdefghijklmnopwrstuvwxyz

Then add commands to create pbrain-style procedures:

:{}

Then add commands to load,store,and exchange with the accumulator:

!@*

Then we add commands to do unary bitwise operations (NOT,LEFTSHIFT,RIGHTSHIFT):

~/\

Then we add commands to do binary bitwise operations(stored on the pointed cell) (AND,OR,XOR):

&|^

Now we have this set:

+-><[],.=()1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ$§¥€¢£₩«»•abcdefghijklmnopwrstuvwxyz:{}!@*~/\&|^

Examples

Cat program

This infinitely repeating cat program employs the loop-while-zero iteration construct (…):

=(,.=)

Truth-machine

This implementation of a truth-machine harnesses the ability to simulate Boolean test results:

,[->+>+<<]>.--------------z[>.<]

Interpreter

  • Common Lisp implementation of the brainfuck instruction extension project.

See also