Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.