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].
others Nop

Examples

  • Hello, world!
72.101.108.108.111.44.32.119.111.114.108.100.33.*
  • Fibonacci Numbers
v        )>+> v
)1)!<10.>|-<<+(
  ^     >(