Ferdi265 / preprocessor_brainfuck

A brainfuck interpreter using only the C preprocessor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Preprocessor Brainfuck Interpreter

This project contains an interpreter for brainfuck programs that is written solely in C preprocessor macros.

How to use

  1. Generate the headers
$ make
  1. Encode your program into main.h, and provide the file used as input
$ ./bf_to_main.sh hello.bf /dev/null > main.h
  1. Run the brainfuck interpreter
$ make run

or

$ make run DEBUG=1

Note

The preprocessor brainfuck interpreter is very very inefficient and will use around 16 GIGABYTES of memory and 15 to 20 minutes of processing time while running hello.bf.

About

A brainfuck interpreter using only the C preprocessor


Languages

Language:C++ 39.9%Language:C 28.5%Language:Shell 17.5%Language:Makefile 13.2%Language:Brainfuck 0.9%