Brainfuck interpreter written in C
Clone or download
fabianishere Add AppVeyor support (#63)
This pull request brings the following changes in order to introduce AppVeyor support:
- **Update the build configuration for CMake 3.1+**  
   This change updates the CMake configuration to make use of the more modern features of CMake supported since 3.1+ like configuring properties of specific targets.
- **Add support for Visual Studio builds**
  This change updates the project so that it can build on Windows platforms using Visual Studio. This requires an external `getopt` dependency. Also, building with `editline` support is not supported at the moment.
- **Add AppVeyor configuration**
  This change adds the necessary configuration in order to build on the AppVeyor platform. 

This pull request allows us to add support and test builds on Windows platforms.
Latest commit cc7cc3a Jul 16, 2018

README.markdown

brainfuck Build Status Build status

Brainfuck interpreter written in C.

Usage

brainfuck [-veh] file...
-e --eval		run code directly
-v --version	show version information
-h --help		show a help message.

The interactive console can be accessed by passing no arguments.

We also provide a C api:

#include <stdio.h>
#include <stdlib.h>
#include <brainfuck.h>
    
int main() {
	BrainfuckState *state = brainfuck_state();
	BrainfuckExecutionContext *context = brainfuck_context(BRAINFUCK_TAPE_SIZE);
	BrainfuckInstruction *instruction = brainfuck_parse_string(",+++++.");
 	brainfuck_add(state, instruction);
 	brainfuck_execute(state->root, context);
	brainfuck_destroy_context(context);
 	brainfuck_destroy_state(state);
	return EXIT_SUCCESS;
}

Examples

Look in the examples directory for a large amount of brainfuck examples.

Getting the source

Download the source code by running the following code in your command prompt:

$ git clone https://github.com/fabianishere/brainfuck.git

or simply grab a copy of the source code as a Zip file.

Building

Create the build directory.

$ mkdir build
$ cd build

Brainfuck requires CMake and a C compiler (e.g. Clang or GCC) in order to run. It also depends on libedit, which is available in the main repositories of most Linux distributions (e.g. as libedit-dev on Debian) and comes with the macOS XCode command line tools. Then, simply create the Makefiles:

$ cmake ..

and finally, build it using the building system you chose (e.g. Make):

$ make

License

See LICENSE file.

Contributors

Fabian Mastenbroek https://github.com/fabianishere
aliclubb https://github.com/aliclubb
diekmann https://github.com/diekmann
SevenBits https://github.com/SevenBits
Alex Burka https://github.com/durka
outis https://github.com/outis
rien333 https://github.com/rien333