Program to convert brainfuck source code into C source code
The program translates Brainfuck code into C using the following substitutions
brainfuck command | C equivalent |
---|---|
(Program Start) | char array[30000] = {0}; char *ptr=array; |
> | ++ptr; |
< | --ptr; |
+ | ++*ptr; |
- | --*ptr; |
. | putchar(*ptr); |
, | *ptr=getchar(); |
[ | while (*ptr) { |
] | } |
MIT