Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillep/pharo-brainfuck
Brainfuck implementation in Pharo
https://github.com/guillep/pharo-brainfuck
Last synced: 16 days ago
JSON representation
Brainfuck implementation in Pharo
- Host: GitHub
- URL: https://github.com/guillep/pharo-brainfuck
- Owner: guillep
- License: mit
- Created: 2017-01-12T13:54:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-12T14:03:23.000Z (almost 8 years ago)
- Last Synced: 2024-10-31T06:42:03.877Z (2 months ago)
- Language: Smalltalk
- Size: 9.77 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pharo Brainfuck
This repository contains a brainfuck (https://es.wikipedia.org/wiki/Brainfuck) interpreter for Pharo.
## Basic API
- `interpret: aProgram`
Interprets a program represented as a string. Invalid characters (other than <>+-[]., are ignored)
Example: `BFInterpreter new interpret: '>>++++>+>++'`
- `outputStream: aStream`
Sets the output stream for a brainfuck program. This is the stream that will be written to when the write operation (`.`) is executed. By default, if an output stream is not set, the standard output will be used.
Example: `BFInterpreter new outputStream: Transcript`.
- `inputStream: aStream`
Sets the input stream for a brainfuck program. This is the stream that will be read to when the read operation (`,`) is executed. By default, if an input stream is not set, the standard input will be used.
Example: `BFInterpreter new inputStream: '88123' readStream`.## Examples
`BFInterpreter` class side contains a couple of examples of brainfuck code to execute.