Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Vinetwigs/gofuck-interpreter
A simple brainfu*k interpreter written in Go
https://github.com/Vinetwigs/gofuck-interpreter
brainfuck brainfuck-interpreter go golang golang-examples golang-module golang-package interpreter module package
Last synced: 28 days ago
JSON representation
A simple brainfu*k interpreter written in Go
- Host: GitHub
- URL: https://github.com/Vinetwigs/gofuck-interpreter
- Owner: Vinetwigs
- License: apache-2.0
- Created: 2021-05-12T17:44:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-14T17:55:34.000Z (over 3 years ago)
- Last Synced: 2024-11-08T22:26:11.205Z (about 1 month ago)
- Topics: brainfuck, brainfuck-interpreter, go, golang, golang-examples, golang-module, golang-package, interpreter, module, package
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-golang-repositories - gofuck-interpreter
README
# GoFuck Interpreter
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/Vinetwigs/gofuck-interpreter)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/Vinetwigs/gofuck-interpreter)
![GitHub last commit](https://img.shields.io/github/last-commit/Vinetwigs/gofuck-interpreter)
[![GoDoc](https://godoc.org/github.com/mewkiz/flac?status.svg)](https://godoc.org/github.com/Vinetwigs/gofuck-interpreter)A basic implementation in GoLang of a BrainFuck esoteric language interpreter.
## Authors
* **Vincenzo Esposito** - [Vinetwigs](https://github.com/Vinetwigs)
## Getting Started
You just need to install the package as dependence and you can start using the interpreter to run your favourite BrainFuck programs :smile:
### Prerequisites
```
Go
```### Installing
#### Install module
```
go get github.com/Vinetwigs/[email protected]
```#### Import in your project
```
import("github.com/Vinetwigs/gofuck-interpreter")
```## How to use
### Create a new interpreter type variable reading from a file
`i := interpreter.NewInterpreterFile(file *io.File, memSize int)`
| Parameter | Description |
|:---------:|:-------------------------------------------------------:|
| file | a pointer to io.File rapresenting the file to interpret |
| memSize | number of cells the memory will be composed of |### Create a new interpreter type variable reading from a path
`i := interpreter.NewInterpreterString(path string, memSize int)`
| Parameter | Description |
|:---------:|:-------------------------------------------------------:|
| path | a string rapresenting the path of the file to interpret |
| memSize | number of cells the memory will be composed of |### Interpret the entire program
`i.InterpretFile()`
### Interpret only the next instruction
`i.Step()`
> Useful for debbugging
## Built With
* [GoLang](https://golang.org/) - The programming language used
## License
This project is licensed under the Apache License Version 2.0 - see the [Apache License](https://www.apache.org/licenses/LICENSE-2.0) site for details