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.

Brafunge

From Esolang
Jump to navigation Jump to search

Brafunge is a cell-based language inspired by brainfuck and Befunge.

Commands

Commands Description
> Move the pointer to right.
< Move the pointer to left.
+ Increment the memory cell at the pointer.
- Decrement the memory cell at the pointer.
. Output the character signified by the cell at the pointer.
! Output the current cell value as integer.
, Input a character and store it in the cell at the pointer.
& Input integer and store it in the cell at the pointer.
_ Horizontal IF: if the current cell value is 0, go right; else go left
| Vertical IF: if the current cell value is 0, go down; else go up
) PC direction right
( PC direction left
^ PC direction up
v PC direction down
? Random direction
/ \ Mirror
# Bridge
@ Set the pointer to the current cell value.
* Quit
[int] Set the value of the cell at the pointer to [int].
'[char] Set the value of the cell at the pointer to the ASCII code of [char]
others Nop

Examples

Hello, world!

72.101.108.108.111.44.32.119.111.114.108.100.33.*

Fibonacci Numbers

v        )>+> v
)1)!<10.>|-<<+(
  ^     >(

Cat Program

The following adduces a character-based cat program arrested in an olamic procession:

),.v
^  (

Truth-Machine

A truth-machine shall limn the following program's patefaction:

&v)!v
 )|^(
  !
  *

Interpreter

  • Common Lisp implementation of the Brafunge programming language.