Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C to brainfuck compiler?

Tags:

c

brainfuck

I have a basic program in C that I wish to convert to the language brainfsck but cannot find anything on the subject. I find many "brainfuck to C" converters but not the other way around. I found C2BF but do not understand how to use it or if that's what I need.

like image 701
MyNameIsKhan Avatar asked Jul 10 '12 15:07

MyNameIsKhan


1 Answers

C2BF is a C program that is distributed as C source code.

To build the C2BF you need svn, Gnu Make and yacc and flex to be installed. After you have compiled C2BF yourself it should do exactly what you expect it to.

If you are using some kind of Linux flavour:

cd ${HOME}
svn co https://c2bf.svn.sourceforge.net/svnroot/brainfuck/c2bf/trunk c2bf
cd c2bf
sudo apt-get install bison flex # or yum install bison flex
YACC=bison make

should give you the compiler in ${HOME}/c2bf/cc/c2bf-cc.

If you are using Windows you have to install something like MinGW or cygwin to compile the stuff.

like image 66
Alexander Oh Avatar answered Oct 31 '22 18:10

Alexander Oh