A small brainfuck interpreter for python, including prettyprint inside
Project description
BrainFuckInterpreter
standard usage:
from brainFuckInterpreter import BrainF
easily get outputs:
for msg in BrainF('yourcodehere'):
print(msg) #msg is what the '.' outputs
or use a comprehension
meg=[i for i in BrainF('yourcodehere') if i]
or just run it at once
print(BrainF('yourcodehere').run()) #what run() returns is a string
attributes
in the iterator called BrainF
:
def __init__(self,code,*,print_memory=True, print_func=None, input_func=None)
- print_memory => bool(is initially set to True)
- input_func => function fot input(is initially set as BrainF.input_in_ASCII)
- print_func => function for printing memory(is not needed when print_memory is set to False)
PrettyPrint!!!
from brainFuckInterpreter import prettyprint
prettyprint(ur list representing memory to print, the index of cell (aka element) u want to emphasize)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
BrainpyFuck-0.0.4.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for BrainpyFuck-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e9f0bef14723afcfb2346f1be9d665f1cb1c3123c483c5d67ca9a7a9e393d06 |
|
MD5 | c6cb5d673316f44c580deb6df2d43185 |
|
BLAKE2b-256 | 61ee01106a763cf337dcc99fb2a63ac14222318e6baa7c8c7e0390338331aa66 |