4 ms·
Awesome! Inspired by a flash of lightning, I wrote a genetic algorithm to generate brainfuck over the past two weeks. It has gotten so far that it generates br
by azeirah 11y ago
Awesome! Inspired by a flash of lightning, I wrote a genetic algorithm to generate brainfuck over the past two weeks.
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...
- vanderZwan 11y agoHave you seen this work? http://www.primaryobjects.com/CMS/Article163 http://www.primaryobjects.com/CMS/Article163
- azeirah 11y agoYep, I have. Pretty cool stuff