4 ms·
Here's a terrible brainfuck interpreter: http://python.pastebin.com/f3d434dd2 http://python.pastebin.com/f3d434dd2 I wrote it as an exercise in functional styl
by pshc 18y ago
Here's a terrible brainfuck interpreter:
http://python.pastebin.com/f3d434dd2 http://python.pastebin.com/f3d434dd2
I wrote it as an exercise in functional style, and so it has no mutation (other than the tuple assignment in the main loop, which I couldn't devise a functional equivalent for). It is incredibly inefficient as a result. But it all fits in a single Python statement, save initialization!