Linear bounded brainfuck

From Esolang
Jump to navigation Jump to search

Linear bounded brainfuck is brainfuck as a linear bounded automaton, created by User:PythonshellDebugwindow.

The input-size function

The function of the input-size used is , where is the length of the input (1 if no input) and is the length of the program.

Commands

The same as in brainfuck, but minus input (which is preloaded onto the tape). The tape without input on it is initialized to all zeros, and all cells are bytes.

Command Description
> Move the pointer to the right
< Move the pointer to the left
+ Increment the memory cell under the pointer
- Decrement the memory cell under the pointer
. Output the character signified by the cell at the pointer
[ Jump past the matching ] if the cell under the pointer is 0
] Jump back to the matching [ if the cell under the pointer is nonzero

Going out of the tape bounds causes the program to error and exit.

Examples

Cat program

Errors at the end.

[.>]

Truth-machine

------------------------------------------------[.].