Brainfunk
Jump to navigation
Jump to search
Brainfunk
Brainfunk is a extension of brainfuck with same eight commands and more eight commands.
Common brainfuck uses only two tapes, a tape for code and a tape for data, brainfunk have also a tape for I/O.
That tape could point to diferent devices as need, mapped as tape cells.
Command | Description |
---|---|
>
|
Move the pointer to the right |
<
|
Move the pointer to the 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 |
,
|
Input a character and store it in the cell at the pointer |
[
|
Jump past the matching ] if the cell at the pointer is 0
|
]
|
Jump back to the matching [ if the cell at the pointer is nonzero
|
Command | Description |
---|---|
=
|
swap tapes |
&
|
reset |
%
|
halt |
$
|
nop |
~
|
unary negation |
!
|
reserved, nop |
?
|
reserved, nop |
@
|
reserved, nop |
To move the I/O tape forward or backward, use '=' to swap which tape is moved by '<' and '>'.
To copy a byte from data tape into i/o tape use '.' and to copy a byte from i/o tape into data tape use ','.
Also, when in homebrew computers, use '&' for reset, '%' for halt, '$' for nop, '~' for unary negation, reserves '?', '!', '@' for future expansion, by now all are nop.