Skip to content
/ bfci Public

A Brainfuck interpreter written in the C programming language

License

Notifications You must be signed in to change notification settings

metamacro/bfci

Repository files navigation

Brainfuck C Interpreter

A Brainfuck interpreter written in the C programming language.

Usage

Invoke the interpreter binary with one positional argument, i.e. the BrainFuck program path, e.g.:

$ ./bfci /path/to/brainfuck/program.bf

Development

No additional dependencies are required besides the usual C development environment. The uthash header only library requires no linking.

After cloning the repository, make sure to:

$ git submodule update --init

Or simply build the project once, since the process is automated via CMake.

Build

Clone the repository via the preferred method.

Generate the build recipes via CMake, e.g.:

$ mkdir build
$ cd build
build $ cmake ..

To enable debugging, set the ENABLE_DEBUG CMake option to ON, e.g.:

build $ cmake -D ENABLE_DEBUG=ON ..

This will enable program TRACE output to stderr.

Invoke the build via Make:

build $ make

Tests

Enable the tests by setting the ENABLE_TESTS CMake option to ON, e.g.:

build $ cmake -D ENABLE_TESTS=ON ..

Execute the tests, e.g.:

build $ ctest

Examples

The examples directory contains BrainFuck example programs.

License

Licensed under the GNU Affero General Public License v3.0.

Refer to the LICENSE file in the repository.