From 3e733ac45becc784edcd668f5d78f9d46c2b2eb3 Mon Sep 17 00:00:00 2001 From: Giovani Date: Sat, 26 Jun 2021 04:13:54 +0000 Subject: [PATCH] chore: update readme --- README.md | 16 ++++++++++------ dopey.py | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5777c7d..df82604 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ The dopey brainf\*\*k interpreter was created as a side project to become familiar with Python 3. The goal was to fully implement all the features of brainf\*\*k as defined in this [wiki page](https://en.wikipedia.org/wiki/Brainfuck#Language_design) into dopey. ## Demo -![gif](https://i.imgur.com/mqjNGzV.gif) +![gif](https://i.imgur.com/9HbBB1k.gif) ## Implemetation Limitations @@ -25,16 +25,20 @@ python3 --version ## Running dopey -Clone the Github repository. From your terminal move to the root of the project and run the following line: +Clone the Github repository and from your terminal move to the root of the project and run the following lines: ```bash -python dopey.py my-bf-file.bf +chmod +x dopey.py +./dopey.py my_file.bf ``` -or in some systems +You can also import an interpreter class included with dopey and use it in your own python scripts. -```bash -python3 dopey.py my-bf-file.bf +```python +from dopey import Interpreter + +interpreter = Interpreter() +interpreter.execute("[brainf*ck code]++-->><<++--") ``` ## Contributing diff --git a/dopey.py b/dopey.py index 3dc9341..cf375c2 100755 --- a/dopey.py +++ b/dopey.py @@ -74,7 +74,7 @@ class _Operation: @classmethod def output(cls, _) -> None: - sys.stdout.write(chr(_Memory.buffer[_Memory.get_pointer()])) # TODO rollover if too big in ASCII + sys.stdout.write(chr(_Memory.buffer[_Memory.get_pointer()])) sys.stdout.flush() # TODO possible performance issue @classmethod