An Optimising BF Compiler
wilfred.me.uk
wilfred.me.uk
It has gotten so far that it generates brainfuck programs that output any number you desire. No input processing though ;(
Here are five different (20-char) brainfuck programs that print 1337.. Note my brainfuck interpreter doesn't output characters, it adds the byte at the current pointer to the output. I suppose that's not real brainfuck...
-.[.>++<+.>]-.><+.[+
++->]-.[+.-.-<++]-->
-[...<[+].++>-.>+]<+
[+++...+.[-[.->.[]][
>->-[..<.->-.<<.+.]+
Now I want to either rewrite it in c (it's currently in js) for the performance increase alone. I might attempt writing an interpreter on my fpga...[1]: https://github.com/bdash/brainrust [2]: https://github.com/bdash/brainrust/blob/master/examples/mand...