Skip to content

A lightweight Brainf*ck interpreter built to execute programs written in the minimalistic Brainf*ck language. This interpreter handles loops, memory manipulation, and basic I/O operations, providing a straightforward implementation for exploring the language's unique structure and constraints.

Notifications You must be signed in to change notification settings

aadhavr/bf-interpreter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zig Brainfuck Interpreter

This repository contains a Brainfuck interpreter written in Zig. It allows you to run Brainfuck code, a programming language with eight commands.

Update

I've been trying to run some more complicated Brainfuck programs and the interpreter is facing issues. Have gotten stuck with debugging and will revisit later. Seems to run pretty basic programs that don't involve complex loops though.

Features

  • Interpret and execute Brainfuck code.
  • Handle dynamic memory allocation for Brainfuck's tape.
  • Input and output operations as specified by Brainfuck's design.

Getting Started

Prerequisites

  • Install Zig on your system.

Building the Project

To build the interpreter, run the following command in the root of the project:

zig build-exe src/main.zig

Usage

To run a Brainfuck program, use the executable generated from the build process:

./main < path/to/your/brainfuck_program.bf

Or you can directly input the Brainfuck code:

echo "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>." | ./main

Contributing

Contributions are welcome! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Licensing

This project is licensed under the MIT License.

About

A lightweight Brainf*ck interpreter built to execute programs written in the minimalistic Brainf*ck language. This interpreter handles loops, memory manipulation, and basic I/O operations, providing a straightforward implementation for exploring the language's unique structure and constraints.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages