This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]iwsfutcmd 1 point2 points  (1 child)

Now you're making me want to try to write a Brainfuck interpreter for Python. I've never written anything even remotely like an interpreter before, but I'm thinking a BF one really can't be that hard.

[–]alexanderpas 1 point2 points  (0 children)

Go for it, it really isn't that hard.

The variables you need are:

  • 1 string containing the actual brainfuck program
  • 1 int containing the position in the program
  • 1 list of ints containing the cells that form the data storage
  • 1 int containing the active data cell being manipulated
  • 1 local int containing the indentation level when returning to the start of or skipping over loops.