Skip to content

Forever-CodingNoob/BrainFuck

Repository files navigation

BrainFuckInterpreter

standard usage:

from brainFuckInterpreter import BrainF

easily get outputs:

for msg in BrainF(code='yourcodehere'):
    print(msg)  #msg is what the '.' outputs

or use a comprehension

meg=[i for i in BrainF(code='yourcodehere') if i]

or just run it at once

print(BrainF(code='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)

About

i fuck my brain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages