Questions tagged [brainfuck]

The brainfuck programming language is an esoteric programming language noted for its extreme minimalism. It is a Turing tarpit, designed to challenge and amuse programmers, and was not made to be suitable for practical use.

Filter by
Sorted by
Tagged with
4
votes
0answers
72 views

Brainfuck interpreter written in Rust

I'm learning Rust at the moment by reading the book (currently on chapter 17). I wrote this simple Brainfuck interpreter, because I think that it's always a fun exercise. The program consists of ...
6
votes
2answers
128 views

115 line brainfuck interpreter written in C++

This is a simple brainfuck interpreter I've written in C++. It takes a path to a brainfuck source file as a command line argument. The program uses a tape size of 30000 and cell size of one byte. ...
3
votes
1answer
51 views

Verbose Brainfuck Interpreter in C

I decided to try and write a Brainfuck interpreter in C as an exercise. This could have been written in one file, but I decided to split it up into a State "class" and an some interpreter methods. An ...
6
votes
2answers
195 views

Program that generates brainfuck code that outputs given text

I created program that generates brainfuck code that outputs given text. Arguments for the program are input file with the text and ...
2
votes
2answers
32 views

Brainfuck interpreter improvement

I created a brainfuck interpreter in javascript. It works good to me as I have seen no bugs in my compiler. I like to get a suggestion and review from you to what should this compiler improve. Here'...
8
votes
2answers
156 views

Brainfuck interpreter in C 3

I created my brainfuck interpreter and I would like to know what can be done better and is the code clear and readable. I will be very thankful for opinions and suggestions. Here is the code: ...
17
votes
1answer
217 views

Brainfreeze: A Brainfuck compiler in C

BrainFreeze This is my implementation of a brainfuck compiler in C. The instruction to build/run the project (GitHub repo) can be found here. I am first converting the brainfuck source to x86 ...
13
votes
1answer
126 views

Brainfuck to NASM compiler in Haskell

After reading this article on writing a Brainfuck interpreter in Haskell and achieving awful performance with it (for example, mandelbrot generating 37.5 minutes on an old Intel Atom powered laptop) I'...
2
votes
1answer
104 views

Simple Brainfuck Interpreter in Rust

Not a long time ago, I got into Rust and I made a simple Brainfuck Interpreter. Now I want to get back to Rust and I would like some comments on my code: Just in case it's hard to read code from post:...
4
votes
1answer
117 views

Main loop in assembly for a Brainfuck interpreter

I have written 2 Brainfuck interpreters, one in C++, then another in C++ with Assembly inner loop. My interpreter code can be found here (C++/ASM, requires MSVC and MASM) and here (C++). Both are ...
7
votes
1answer
200 views

A simple brainf*** interpreter in Haskell

I am very new to Haskell and come from languages like C++, although I do have some experience with Scheme. Here, I wrote a simple brainf*** interpreter, which so far is my largest project. I followed ...
5
votes
2answers
145 views

Brainfuck to Python compiler

So this is (I think) a premiere for python. A function that translates brainfuck code to python code. It does a few optimizations (It chains +,...
5
votes
1answer
66 views

Interactive complete Brainfuck Interpreter

This is another Brainfuck interpreter in Python. I personaly think this is better than most of the other once you find online, because it keeps a bracket_map, which ...
37
votes
0answers
1k views

JSON formatter in your least favorite language

Just joking guys, Brainfuck is an awesome, challenging language. I've tested the following code with bf-x86 compiler and rather big JSON file. I believe code is fully functional on a valid (!) JSON ...
3
votes
1answer
99 views

AST-based Brainfuck interpreter in Haskell

Since implementing my Interactive Brainfuck interpreter in Haskell I figured that it would be a good idea to build upon an Abstract Syntax Tree. I have also decided to drop replacing the ...
15
votes
2answers
168 views

Interactive Brainfuck interpreter in Haskell

Last week I started learning Haskell, and since I have some experience with Brainfuck already, I decided it would be a great idea to implement an interactive Brainfuck interpreter in Haskell. I'll ...
9
votes
2answers
124 views

Reverse multiple strings separated by comma

Recently I did a lot of practice problems in brainfuck to learn better about how to use it (and to get more competent in general). Today I write a program to manipulate the input such that every word (...
7
votes
0answers
202 views

Optimized FizzBuzz in brainfuck

While looking for brainfuck related things, I came across Simon Forsberg's FizzBuzz in Brainfuck and cheekily commented a link to my own brainfuck FizzBuzz answer over on PPCG. He suggested I should ...
7
votes
1answer
2k views

Text to Brainfuck translator

I just wanted to mess with my friend a little and wanted to text him in Brainfuck. Being a coder like me, I decided, why not just write a quick script to translate it for me? Considering that most ...
5
votes
1answer
149 views

Brainfuck interpreter in F# (by a C# developer)

I'm a C# developer learning F#. I have a lot of questions about practices and principles within the code. I would like to know what a "native" F# developer would've done differently. ...
2
votes
1answer
103 views

Haskell Brainf*ck interpreter: runtime error handling

I have designed a Brainf*ck interpreter in Haskell. I would appreciate the code review, especially any tips related to error handling (e.g. parsing errors, runtime errors, etc.). ...
6
votes
1answer
99 views

Yet another BrainF*** Interpretter in Haskell

I wrote a BrainF*** interpretter in Haskell. A general review would be helpful and especially, a suggestion with a better way to deal with the IO (IO Memory, IO ()) ...
3
votes
1answer
87 views

Python Brainf*ck interpreter

What do you think of my Brainf*ck interpreter? What else can be done to increase speed? ...
15
votes
0answers
371 views

BF welcomes Fibonnaci

Slightly inspired by a previous question/april fools joke I decided to take on Fibonnaci sequence in the lovely language Brainfuck. In order to do this I have also worked on Brainduck, which is a ...
5
votes
0answers
86 views

Clojure BrainF*** Interpreter

Since I want to try writing my own language at some point, I wanted to have some experience writing an interpreter. BrainFuck is the simplest language I (kind of) know, so I decided to try writing an ...
5
votes
0answers
95 views

brainF*** interperter in lua

For a personal project I may need to load and execute something that will basically be a very simple programming language. Though I am not at all close to this part of the project yet and I can most ...
3
votes
1answer
153 views

Brainfuck interpreter using interpreter and composite patterns

I wrote this brainfuck interpreter in C++ using interpreter and composite patterns. I would like to make this code more scalable. Indeed, if we need to add a extra command, we'll have to add a new ...
3
votes
1answer
321 views

Brainfuck Brute Force

I am trying to brute force code Brainfuck code to get the desired output. For this, I need my code to be as fast as possible. I am fairly new to Java and making my code fast, in general, so don't ...
4
votes
1answer
89 views

Brainf**k interpreter in Ruby

I wrote this interpreter for a code challenge. Can this be written any cleaner/smaller? Could I reduce the amount of nested conditional/loops? ...
3
votes
1answer
120 views

YABI: Yet Another Brainfuck Interpreter written in C

Syntax is ./bf-interpreter <program.bf>. ...
2
votes
2answers
296 views

Brainfuck code optimization in Python

I wrote a program to automatically optimize my Brainfuck source files. It works well, but the optimizations are only trivial ones and probably there are still some other points to improve. ...
38
votes
2answers
971 views

Brainfuck to x86 Assembly Compiler

After my Brainfuck Interpreter written in x86 Assembly I decided that it was time to get to the next step, writing a Brainfuck Compiler in Java that generates x86 Assembly and compiles that to an ...
72
votes
2answers
8k views

Brainfuck Interpreter written in x86 Assembly

Story time: A week ago I found a question about optimizing Assembly code, then I remembered how awesome Brainfuck was, and the match was made very quickly. I decided to write a Brainfuck Interpreter ...
4
votes
0answers
155 views

Simple Brainf_ck IDE in JavaFX 8

I have this simple IDE for playing with Brainf_ck. It has no file functionality; only the code, input and output fields are present, and the "compiler" is integrated. Here is how it looks like: My ...
6
votes
1answer
326 views

Brainfuck compiler with tcc backend

I wrote simple compiler for Brainfuck with tcc backend (dont ask for assembler/assembly code generator!). It's output runs incredibly slow. Even Hello World program takes a LOOONG while to execute. I ...
15
votes
2answers
3k views

A completely overkill BrainFuck lexer/parser

I'll need to build a syntax tree (AST) for Rubberduck, but since VBA has dozens of tokens and complex rules, I needed a simpler language to play with first, so I thought BrainFuck would be a perfect ...
7
votes
1answer
442 views

Object-oriented Brainfuck interpreter

Inspired by this question, I decided to give it a try and implemented a brainfuck interpreter myself. It includes various improvements: It's object-oriented and modular Unlimited tape size It ...
4
votes
2answers
600 views

BF interpreter written in C#

I have recently written a Brainfuck interpreter in C#. I tested it with the examples given on EsoLang website. It does not handle errors right now. Questions: Even that it can run only one program ...
7
votes
1answer
134 views

Ruby Brainfuck interpreter

I recently wrote a simple Brainfuck interpreter in Ruby: ...
15
votes
1answer
367 views

Brainfuck with C# operator overloading

I overloaded some C# operators to get a pseudo version of the Brainfuck symbols in the effort of understanding the flow of this language. I got this version: ...
4
votes
2answers
124 views

Java Brainfuck Interpreter Method

Due to the fact that nobody's ever posted this before (sarcasm) I've made a brainfuck interpreter in java. The interpreter fits in a single method, and is designed to be readable, fast, and concise, ...
8
votes
3answers
254 views

Brainfuck interpreter in C - follow-up

A little over a week ago I posted my basic Brainfuck interpreter here. I have since improved the interpreter on all suggested points except two minor details. (reporting the position of parsing error, ...
8
votes
2answers
496 views

A brainfuck interpreter in python 3

I've been writing a brainfuck interpreter in python 3. It's nothing serious, but I'm trying to make it as good as possible (considering program structure, user experience and etc) for my own learning ...
5
votes
2answers
2k views

Basic Brainfuck Interpreter in C

I have written a small Brainfuck interpreter in C. More recent version hosted here. I have found it very hard to test my interpreter because writing a program in Brainfuck is somewhat hard (or at ...
13
votes
2answers
902 views

Brainf*ck interpreter written in x86 assembly

I have written a program in x86 assembly (Intel syntax/MASM) that interprets brainfuck code that is fed to it via an interactive console and prints the final stack to stdout. Note that it does not ...
42
votes
1answer
3k views

Charmander Brainfuck interpreter in Haskell

I just started learning Haskell and this is my first big project (ie not factorials, fibonacci or graphers). This is kind of a gift for somebody so the language is a bit different. The program works, ...
5
votes
1answer
257 views

My Brainfuck interpreter in F#

I'm very new to functional world. I've written a simple brainfuck interpreter as my first F# program. What I would like to know: Am I using the right data structure for each situation? Is my code ...
5
votes
2answers
322 views

BF interpreter in Python that uses recursion to handle loops

I wrote a Brainfuck interpreter in Python and I'm wondering how to simplify it. I handle separately loop commands and the others. A recursive function deals with loops. ...
-3
votes
1answer
154 views

JavaScript Brainfuck interpreter [closed]

I wrote a Brainfuck interpreter in JavaScript, however it is quite buggy and I can't figure out what I'm doing wrong. It works for programs I've written, but fails on most programs I find on the ...
3
votes
1answer
2k views

Fibonacci Sequence in BrainF***

I have been trying to write a BrainF*** program that prints the Fibonacci sequence numbers repeatedly. I was wondering whether this is the most efficient way to do it. I basically repeatedly duplicate ...