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.
115
questions
4
votes
0
answers
142
views
tbf - A Brainfuck Interpreter and Transpiler in C
Language:
The Brainfuck programming language consists of eight commands:
...
7
votes
3
answers
5k
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 ...
11
votes
2
answers
2k
views
Brainfuck to C transpiler
I have been working on making a transpiler from Brainfuck to C in C(11), here is the code:
...
2
votes
0
answers
63
views
Print all printable ASCII characters
Code:
...
3
votes
1
answer
99
views
BF Interpreter in C++
Need to clear my brain.
BF interpretor in C++.
bf.h
...
0
votes
0
answers
50
views
Mac M1 .BF Compiler in Rust
I'm writing a brainfuck compiler in rust, that takes brainfuck instructions and converts them to a very basic assembly form, and then compiles that into binary, if you are not familiar with brainfuck ...
4
votes
1
answer
248
views
200 line Brainfuck Interpreter
I wrote a simple brainfuck interpreter in C99. Coming from a background of C++ made the task easier, but still there is some stuff I had to get used too. The program accepts a path to a brainfuck file ...
6
votes
1
answer
165
views
Add two values in brainfuck
I'm currently learning brainfuck as a challenge for golfing, and I'd like a code review to make sure I'm understanding things properly. For starters, here's my snippet:
...
2
votes
1
answer
133
views
Simple Brainfuck interpreter in C with support for nested subroutines
Wrote a simple brainfuck interpreter that supports nested subroutines ([ ] commands).
...
-1
votes
1
answer
150
views
Brainfuck interpreter in C, looking for improvements on the looping functionality [closed]
I've just started to get into PL design and made a simple Brainfuck interpreter. Although it is functional, I don't feel too confident on the execution, particularly the implementation for loops, I ...
4
votes
1
answer
225
views
A Brainfuck compiler that creates a small x86_64 Linux executable from scratch
This program compiles Brainfuck source code to an x86_64 ELF executable. It doesn't rely on any backend, just raw binary stream to a functional executable.
In the implementation, each cell holds an 8-...
3
votes
1
answer
144
views
Simple Brainfuck Interpreter Implementation in C
I wanted to implement a short and functional brainfuck interpreter with minimal code repetition. It uses a little bit of macro magic, and does nested loops iteratively rather than using a cache, but ...
1
vote
1
answer
74
views
Go Brainf*ck Interpreter
Recently wrote a brainfuck interpreter in Go.
Here's the Github Repo Brainfuck
Areas that need work
The parsing for brackets [] is still buggy and is known to fail ...
7
votes
1
answer
389
views
A beginner's brainfuck interpreter in Haskell
I am rather new to haskell, and could use some feedback on my code and the decisions I had to make. In my previous project, I made a JSON parser, but relied heavily on guidance from a university ...
4
votes
1
answer
323
views
Simple Brainfuck Interpreter in C
This is a simple interpreter for the esoteric brainfuck programming language, written in C. It is one of my personal projects and I would love to receive expert advice.
Behavior
All characters except ...
7
votes
1
answer
1k
views
Brainfuck interpreter in C++ with namespaces
I wrote this small Brainfuck interpreter in C++ where the different op codes are handled in one big switch-case statement instead of something like a tokenizer as Brainfuck is very simple in that ...
7
votes
1
answer
332
views
Brainfuck interpreter utilizing idiomatic Rust
I'm learning Rust at the moment, I've read the book and been just playing around with the language. I wrote this simple Brainfuck interpreter, because I think that it's always a fun exercise. The ...
25
votes
4
answers
5k
views
A brainfuck interpreter in C
I wrote brainfuck interpreter in order to prepare myself for a C job. I try to write the code as clear and as defensively as I can. Can somebody take a look at the code and give me some hints for ...
23
votes
1
answer
732
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 ...
3
votes
1
answer
209
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:...
11
votes
1
answer
795
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 ...
44
votes
1
answer
2k
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 ...
2
votes
1
answer
210
views
Brainfuck Interpreter in C++17
I built a Brainfuck interpreter. It seems to be working. I ran the game of life and this tic-tac-toe and other programs on it. They worked fine. I'd appreciate any comments on correctness, readability ...
40
votes
4
answers
11k
views
Brainfuck interpreter written in C
I am a beginner with regards to C; I'm used to using high-level languages (Java, Python, JS, etc) and this is my first project in a lower-level language. I wrote a simple Brainfuck interpreter, given ...
11
votes
2
answers
394
views
BrainF**k interpreter in python
Here's what I've come up with:
...
8
votes
1
answer
473
views
Brainfuck compressor in Python
Just for fun, I created a script called TinyBF which can compress Brainfuck programs into a format half their size. For example, take a famous hello world program clocking in at 78 bytes:
...
5
votes
2
answers
177
views
BrainF**k interpreter in C++
This question is the adaptation of this question in C++. (I'm the author of that code as well).
The code:
...
11
votes
1
answer
292
views
Portable BrainFuck Interpreter in ANSI C89
I wrote this BrainFuck interpreter in ANSI C89:
...
7
votes
2
answers
2k
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
1
answer
119
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 ...
7
votes
2
answers
434
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 ...
8
votes
2
answers
221
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:
...
2
votes
2
answers
67
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'...
17
votes
1
answer
651
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
1
answer
304
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'...
7
votes
1
answer
268
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 ...
4
votes
1
answer
386
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 ...
25
votes
3
answers
593
views
Printing multiplication table to 12 × 12
Now, a while ago, I said in chat:
I'm done with BF programming.
Except I guess I was lying. Here's a Brainfuck program I wrote, that prints out the multiplication tables up to 12. Fairly simple; ...
50
votes
4
answers
7k
views
ASCII table in Brainfuck
I made my first Brainfuck program today, which prints the numbers 0-255 and the corresponding character.
I was wondering if I could improve my program, as I'm repeating myself a lot (e.g. 3 x copy &...
108
votes
2
answers
14k
views
FizzBuzz in Brainfuck
Inspired a bit by a previous Brainfuck question and the recent fizzbuzz invasion, I decided to make FizzBuzz in Brainfuck.
The code is entirely my own, except for the inclusion of the Printing a ...
5
votes
2
answers
452
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
1
answer
123
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 ...
3
votes
1
answer
220
views
YABI: Yet Another Brainfuck Interpreter written in C
Syntax is ./bf-interpreter <program.bf>.
...
7
votes
1
answer
156
views
Brainfix to NASM converter written in C (revision 2)
See this post for the previous question. I have made several enhancements to this compiler and language that make it a lot easier to work with, as well as slightly decreasing executable size (if new ...
6
votes
2
answers
320
views
Brainf*ck to NASM converter written in C
I have made a very simple Brainfuck to NASM converter, that is usable for practically all programs. It has one trivial optimisation (to subsitute ADD for ...
34
votes
1
answer
1k
views
Rust Brainfuck interpreter
I took the code from kostyas benchmarks for the Rust Brainfuck interpreter and tried to optimize it. There is also a discussion on Reddit about the poor performance of Rust in the Benchmark.
Before ...
3
votes
1
answer
237
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 ...
4
votes
0
answers
168
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 ...
15
votes
2
answers
337
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
2
answers
232
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 (...