NiumXp / pyfuck

One line Brainfuck interpreter in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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, ...]

About

One line Brainfuck interpreter in Python

License:GNU General Public License v3.0


Languages

Language:Python 100.0%