Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagoslino committed Sep 12, 2023
1 parent f92948a commit f8d268d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,28 @@ After cloning this repo, open a workspace in Cuis and type:
```Smalltalk
Feature require: #'BrainFuck'.
```

## To try it out
```Smalltalk
(BFInterpreter program: myBrainFuckProgramInAString) executeProgram.
```
### You can find some examples in BFInterpreter's class side methods, categorized under "examples".

The output is sent to the Transcript.
![hello_bf](https://github.com/thiagoslino/BrainFuck/assets/1688134/e2437dff-7237-4fa5-a153-5e3d74012aed)

### You can output to any stream (outputTo:) and to a file (outputToFile:).
![file_bf](https://github.com/thiagoslino/BrainFuck/assets/1688134/ba05d7d9-e82a-454c-bf14-067a0fabc0ba)

### You can read a program from a file (using programFile:)
```Smalltalk
| p |
p := BFInterpreter programFile: '/path/to/file'.
p executeProgram.
```

## References

- http://www.squeaksource.com/BrainFuck.html
- https://blog.klipse.tech/brainfuck/2016/12/17/brainfuck.html
- https://esolangs.org/wiki/Brainfuck_implementations

0 comments on commit f8d268d

Please sign in to comment.