Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tosox/brainfuck-interpreter
A simple CLI based Brainfuck interpreter written in Java
https://github.com/tosox/brainfuck-interpreter
brainfuck cli interpreter java maven tosoxdev
Last synced: 8 days ago
JSON representation
A simple CLI based Brainfuck interpreter written in Java
- Host: GitHub
- URL: https://github.com/tosox/brainfuck-interpreter
- Owner: Tosox
- License: mit
- Created: 2023-10-16T18:25:07.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-17T13:35:29.000Z (about 1 year ago)
- Last Synced: 2024-01-28T13:57:10.905Z (10 months ago)
- Topics: brainfuck, cli, interpreter, java, maven, tosoxdev
- Language: Java
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Brainfuck Interpreter
A simple Brainfuck interpreter written in Java. Brainfuck is an esoteric programming language known for its minimalistic design, consisting of only eight commands.
## Features
* Interprets Brainfuck code from the command line or a file
* Supports the standard Brainfuck commands: `>`, `<`, `+`, `-`, `.`, `,`, `[`, and `]`
* Simulates cell memory with a maximum size of 65,535 cells
* Interactive mode if no file is provided
* Outputs the interpreted results as text in the command line## Usage
You can use this Brainfuck interpreter in two ways: interactive mode and file mode
* Interactive mode: enter your Brainfuck code when prompted
* File mode: Pass the path to the Brainfuck file as the first argument## Brainfuck Commands
* `>`: Increment the data pointer.
* `<`: Decrement the data pointer.
* `+`: Increment the byte at the data pointer.
* `-`: Decrement the byte at the data pointer.
* `.`: Output the byte at the data pointer as a character.
* `,`: Read a character and store it in the byte at the data pointer.
* `[`: Jump forward to the command after the matching `]` if the byte at the data pointer is zero.
* `]`: Jump back to the command after the matching `[` if the byte at the data pointer is nonzero.## Example
An example Brainfuck code to print "Hello, World!":
```brainfuck
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++.>++++.------.--------.>+.>.
```Run the interpreter as shown in the usage instructions to see the output.