Brainfuck, but every + is replaced with the bee movie script
Brainfuck, but every + is replaced by the bee movie script, or Beefuck for short, is a Brainfuck derivative created in 2017. It is Turing-complete.
Cells in Beefuck are required to have a range of at least 2^32-1. This rule is intended so you can't "cheat" by substituting the increment command for a bunch of decrements, as that many decrements would be longer than the increment command. This can be circumvented by utilising wraparound and decrementing in a loop (example below).
Syntax
Beefuck supports the following commands:
Command | Description |
---|---|
>
|
Move the pointer to the right |
<
|
Move the pointer to the left |
According to all known laws of aviation, there is no way a bee should be able to fly. Its wings are too small to get its fat little body off the ground. The bee, of course, flies anyway because bees don't care what humans think is impossible. Yellow black, yellow black ...[sic] - full command here, although that transcription of the command contains several mistakes - e.g. many Cs are replaced with Os. In the interest of ease of implementation, interpreters are permitted to accept either the correct version, or this one, or even both! Line breaks are optional.
|
Increment the memory cell under the pointer |
-
|
Decrement the memory cell under 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 forward to the matching ] if the cell under the pointer is zero
|
]
|
Jump back to the matching [ if the cell under the pointer is nonzero
|
Note that the increment command contains characters such as .
and ,
. These punctuation marks must be ignored if part of an increment command. But they must be treated as beefuck code if only part of the increment command is there, the rest missing or incorrect.
Examples
Increment cheat
->--[<->-]
Hello World program
->-----------[<->-]< [ > ->-----------[<->-] >->--------[<->-] >->-----[<->-] <<<< <<- ] >>> ->---[<->-]<. << ->--[<->-]<. ->--------[<->-]<.. ->----[<->-]<. >>>> ->-----[<->-]<. ------------. <<<< ->---------[<->-]<. --------. ->----[<->-]<. ------. --------. >>>> ->--[<->-]<.
Other examples of beefuck code that contain the increment operator are ommited here, partly due to their large file size, and partly because of potential copyright issues.
Implementations
Wow! You can now compile brainfuck to beefuck and run your beefuck programs using this AMAZING implementation!!!