I couldn’t sleep, so naturally I wrote a brainfuck interpreter.
Actually, if you want to get technical I wrote this a while ago. I spent about 2 days on it, and in the end just could not get the bastard thing to work. No matter what I tried, my brain just fell in a steaming heap when it came to make the loop constructs work when nested.
Imagine my dismay when, sleep deprived and emotionally drained it took me about 45 minutes to completely throw away about 80% of the original codebase and replace it with a workable replacement (Works with stack depths of up to python’s recursion limit) and another 30 to prettify, optimise slightly and document the codebase.
Take a look, and by all means make suggestions, it’s by no means perfect.
Source is a available here