-
Notifications
You must be signed in to change notification settings - Fork 0
endless tape brainfuck interpreter
License
jchmrt/etbi
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ENDLESS TAPE BRAINFUCK INTERPRETER ______________ __________________________ / \ __________________________ / / / / / / / etbi \ \ \ \ \ \ \ 0 / 0 / 0 / 0 / 0 / 0 / 0/__________________\0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 _/___/___/___/___/___/___| |___\___\___\___\___\___\_ | +-<>.,[] | |__________________| a brainfuck interpreter featuring an endless tape in both directions ---------------------------------------------------------------------- etbi can interpret brainfuck source files with an endless tape of cells with the size of a char, initially set to 0. Use it with `etbi FILE', or run one of the built-in examples with `etbi -e NAME'. You can always get help with `etbi --help'. etbi also features an interactive REPL-like (Read Eval Print Loop) mode, which you can access using `etbi -i'. In the interactive mode you can easily test snippets of brainfuck code, after which the new state of the tape is shown for easy debugging. The interactive mode features a few other modes, which you can see by typing `!help'. etbi implements a few simple optimizations: - Movement contraction: multiple movement instructions following each other are added together to one instruction with an argument. - Alteration contraction: multiple alteration instructions following each other are added together to one instruction with an argument. - Clear loop optimization: loops which can only end with the current cell ending up empty such as '[-]' are converted to a single clear instruction which sets the current cell to 0. - Scan loop optimization: loops which are scanning all cells in a direction until they find one set to 0, such as '[>]' are converted to a single instruction which uses memchr or memrchr to find one faster. To install etbi simply run `./configure && make && sudo make install'. etbi is licensed under the GPLv3+, see `COPYING' for the full license text.
About
endless tape brainfuck interpreter