Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 675 Bytes

README.md

File metadata and controls

29 lines (25 loc) · 675 Bytes

pyfuck

One line Brainfuck interpreter in Python

Note

The implementation don't use

  • +, - (only to do -1, etc...), <, >, etc...;
  • No keywords, except lambda;
  • No ' and ";
  • No numbers, except 0.

I don't know why, but the code doesn't work correctly...

How to use

from pyfuck import brainfuck

code = """
++++++++++[>++++++++>+++++++++++>++
++++++++>++++>+++>++++++++>++++++++
++++>+++++++++++>++++++++++>+++++++
++++>+++>+<<<<<<<<<<<<-]>-.>--.>---
.>++++.>++.>---.>---.>.>.>+.>+++.>.
"""
code = brainfuck(code)
code.exec()  # Ola, Mundo!
code.a == [0, 79, 108, 97, 44, 32, 77, 117, 110, 100, 111, 33, 10, 0, ...]