Skip to content

nickhen/C_BrainFxxk_Interpreter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brainfuck

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 <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;
}

Getting the source

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

$ git clone https://github.com/FabianM/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. 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 M. https://github.com/fabianm mail.fabianm@gmail.com
aliclubb https://github.com/aliclubb
diekmann https://github.com/diekmann
SevenBits https://github.com/SevenBits
Alex Burka https://github.com/durka durka42@gmail.com

About

Brainfuck interpreter written in C.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Brainfuck 98.7%
  • C 1.3%