Questions tagged [brainfuck]
This challenge is related to the BF language. Note that challenges that require the answers to be in a specific language are generally discouraged.
80
questions
4
votes
8
answers
2k
views
Convert 8 Bit brainfuck to 1 bit Brainfuck / Boolfuck
Goal
Input is a Brainfuck program for 8 bit cells, output it for 1 bit cells.
Explanation
We all know Brainfuck, normally it uses 8 bit cells. But there are implementations where a cell is just 1 bit, ...
13
votes
15
answers
1k
views
Do something you can't do in Brainfuck [closed]
Goal
Do some action (like delete a file, connect to a server, …) that you can not do in standard Brainfuck.
What
As you know, all calculations you can do in almost any programming language you can ...
18
votes
3
answers
948
views
Magical BF: BF code that works in two ways
Challenge
In this challenge, we will use a language that is very similar to Brainfuck but slightly different.
This variant of BF does not have any input and output commands; instead, it simply takes ...
-2
votes
3
answers
384
views
Make a Brainfuck Interpreter [duplicate]
There already is a Brainfuck interpreter question, but it is from 2011 and not up to date with current site standards and vague in places. I have proposed reposting this in chat, and it was well-...
4
votes
1
answer
397
views
Convert 256-wrap brainfuck into 257-wrap brainfuck
Usually each cell in brainfuck has 256 states, which is not enough to tell whether input is EOF or a character (usually \xFF). To fix it we can add one more state ...
10
votes
3
answers
1k
views
Build an optimizing Brainfuck compiler/interpreter
the goal
Build an optimizing Brainfuck implementation. Whether it is a compiler, an interpreter, a JIT compiler, or whatever else is up to you.
scoring
A reference implementation (...
3
votes
4
answers
680
views
ASCII Brainfuck
Given a random code written using Brainfuck commands. You program should translate that code into the following ascii art: each Brainfuck command represents as 5x9 ...
13
votes
2
answers
451
views
Translate an arithmetic expression to Brainfuck
Write a program that translates an arithmetic expression to a Brainfuck program which evaluates the expression and prints the result in decimal numbers. For example, this arithmetic expression,
...
21
votes
5
answers
3k
views
Will one-cell brainfuck halt?
Brainfuck is an esoteric programming language that is Turing Complete, meaning you can't tell whether a given program will halt without running it. It's cell-based and has an infinite tape of cells, ...
21
votes
16
answers
5k
views
Write a Stack Exchange compliant brainfuck explainer
You are to take a string representing a piece of brainfuck code and Explanations, containing only printable ASCII characters and newlines ( to ...
9
votes
1
answer
450
views
BF memory layout optimizer
Given a BF program consisting of only the characters +-[]<>., with the property that there's an equal number of < and <...
4
votes
0
answers
220
views
5 tasks in (modified) BrainF**k from the Estonian OI [closed]
Introduction
This challenge appeared in the 2020 Estonian Open Informatics Olympiad and was created Sandra Schumann. I thought it was interesting because it involves symmetry and is quite hard even to ...
0
votes
2
answers
208
views
Brainfuck movement [closed]
A normal Brainfuck program starts out with an array of cells, all containing the number 0. This program, on the other hand, must be able to run starting with any ...
15
votes
45
answers
2k
views
Is it a brainfuck instruction?
A very simple challenge today. Output a truthy value whether the ASCII character (or it's code) supplied is a brainfuck instruction (one of +-,.<>[]), and a ...
3
votes
9
answers
911
views
Lazy brainfuck programmer [closed]
Background
Joe is working on his new Brainfuck answer on Codegolf. The algorithm he's using to solve the challenge is a bit complicated, so Joe came up with idea of simplifying his Brainfuck notation ...
39
votes
18
answers
8k
views
Generate Brainfuck for the numbers 1–255
Write a program that, for the numbers 1 through 255, prints out BF code that will produce the given number in some byte of the array, plus a newline.
For example, the first four lines of the output ...
6
votes
1
answer
636
views
Multiplication in Brainfuck - minimum number of evaluations [closed]
Given two numbers in tape location #0 and tape location #1 in Brainfuck, compute their product into another tape location (specify with answer). Optimize for the least amount of time-units used, where ...
12
votes
3
answers
3k
views
Print 'A' 1000 times with BrainFuck
What is the best BrainFuck code (in terms of code size) to print 'A' 1000 times ?
My approach is:
set 'A' to p[0]
set 255 to p[1] to display 255 'A', 3 times
set 235 to p[1] to display 235 'A'
This ...
-2
votes
1
answer
275
views
BF Last binary digit [duplicate]
Task
Your task is to write as short as possible program preferably in Brainf**k which determines the last digit of given number after it's conversion from decimal to binary system.
Input
An integer ...
16
votes
3
answers
982
views
Make a longer lenguage program
Lenguage is a brainfuck dialect that is notorious for breaking source restriction challenges. That is because Lenguage cares only about the length of it's source and not the contents.
First, the ...
10
votes
5
answers
2k
views
Largest Number in Brainfuck BigInt for each program length up to 50 instructions
This challenge is for the largest finite number you can get BrainFuck programs of given lengths to contain in memory.
We must use one of the BF versions that uses big integers for the cells rather ...
6
votes
8
answers
686
views
Transpile Brainstract to Brainfuck
Introduction
Brainstract, a newly created dialect of Brainfuck adds a bit more elements to the syntax. In addition to the normal Brainfuck syntax, there are macros. To define a macro:
...
22
votes
1
answer
641
views
Traceless Busy Beaver
All those busy beavers made quite a mess. They wrote all over the tape. At this rate, our neighbour will stop lending us unbounded tapes.
We need a new way to play the busy beaver game, one that ...
11
votes
5
answers
1k
views
Compose two Brainfuck programs
Given 2 brainfuck code snippets A and B, output some brainfuck code C which has the same ...
10
votes
5
answers
446
views
Interpret TwoMega
In this challenge, you will write an interpreter for 2Ω (transcribed as TwoMega), a language based loosely on brainfuck with an infinite-dimensional storage space.
The Language
2Ω contains three ...
32
votes
3
answers
1k
views
The cell at the end of the rainbow
We all know of, or at least have heard of, brainfuck, one of the most famous and influential esoteric languages. While these days most implementations use an infinite tape, the original compiler by ...
32
votes
14
answers
3k
views
Are circular tapes exciting?
A Brainfuck derivative
Let's define a simple Brainfuck-like programming language.
It has a two-directional tape of cells, and each cell holds one bit.
All bits are initially 0.
There is a moving head ...
-4
votes
1
answer
918
views
Biggest number challenge (Brainfuck) [duplicate]
This is a brainfuck version of Largest Number Printable, and this.
Let's think about brainfuck interpreter such that,
Has array that can be stretched left & right arbitrary large
Each cell can ...
14
votes
29
answers
6k
views
RLE Brainfuck dialect
RLE Brainfuck
(related to BF-RLE)
The hypothetical RLE (Run-Length Encoding) dialect of Brainfuck accepts the symbols for the 8 commands and also accepts digits. The digits are used to represent the ...
0
votes
1
answer
121
views
Create a BijectiveBrain [duplicate]
Create a bijective function between the syntactically valid BF programs and the natural numbers
This means that you will assign each BF program a nonnegative integer (0,1,2,...) in such a way that ...
7
votes
5
answers
924
views
Trivial Brainf**k Substitution Interpreter
Brainf**k is the most famous esoteric programming language and is the inspiration for hundreds of other esoteric languages. In fact, there are quite a few languages that are so heavily based off of ...
29
votes
2
answers
2k
views
Zero an arbitrarily large cell in Brainf***
Your task is to write a piece of code that zeros the current cell in the Brainfuck variant that, each cell can contain a signed integer of arbitrarily large magnitude, instead of the normal 0 to 255.
...
15
votes
1
answer
667
views
Programming in two time dimensions
It's a funny accident that this world happens to have just 1 time dimension, but it doesn't have to be like that. It's easy to imagine worlds with 2 or more time dimensions, and in those worlds you ...
8
votes
1
answer
757
views
Large Numbers in BF
Background
The language BrainF*** (or simply BF), is an extremely minimal programming language. We're going to strip it back even further by eliminating IO operations; only the sub-langage defined by ...
6
votes
4
answers
816
views
Busy Brain Beaver reboot [duplicate]
Introduction
I found a really interesting puzzle it was called Busy Brain Beaver. But it has been 3 years since the latest activity and there are some things I didn't like about it. So I decided to ...
10
votes
1
answer
622
views
Braincopterify an image
Introduction
Braincopter is an esoteric Brainf*** derivative that encodes a Brainf***
program as an image. As a 2D language, it uses two additional commands; they
rotate the instruction pointer (...
20
votes
3
answers
1k
views
Brainf*ck Loop Problem
I have a problem for a cyber club that asks you to print:
ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!
Using Brainf**k in 29 bytes or ...
23
votes
36
answers
5k
views
bfcat - encode a file as a brainf*** program
Challenge
Write a program or function that given a string, returns a valid Brainfuck program that when compiled and executed as Brainfuck, returns that string..
Assume all inputs are encoded as ASCII....
20
votes
1
answer
1k
views
Bootloader golf: Brainf***
Create a bootloader that executes given Brainfuck program. This is code-golf, so the program with least bytes wins. Being a bootloader, the size of the program is counted in non-zero bytes in the ...
45
votes
28
answers
6k
views
Translate oOo CODE
Given an input of a program written in oOo
CODE, output the BF code that it
represents.
Here is a short description of how oOo CODE works:
First, all non-alphabetic characters are removed (...
8
votes
2
answers
404
views
TinyBF to Brainf*** converter
We have a Brainf*** to TinyBF converter, but not the other way around, so here's one.
Rules:
Your interpreter must take a valid TinyBF program, on one line, and it must output the corresponding ...
25
votes
7
answers
2k
views
Generating Brainf*** NOPs
Sometimes when writing brainfuck code, you feel the need to make it longer than needed to encourage debugging. You could do it by just plopping a >< in there, ...
1
vote
1
answer
592
views
Convert Brainfuck to another language! [duplicate]
The Task
Write the shortest program, that accepts script in brainfuck from STDIN (or equivalent) and outputs to STDOUT (or ...
28
votes
2
answers
1k
views
Convert Brainfuck to MarioLANG
MarioLANG is a two-dimensional programming language where the source code resembles a Super Mario Bros. level. Furthermore, its instruction set is very similar to Brainfuck's. This means that ...
45
votes
3
answers
3k
views
Enumerate valid Brainf**k programs
Golunar/Unary is a way to encode all valid Brainfuck programs, but it is not an enumeration, since most natural numbers do not correspond to a valid program.
For the purpose of this challenge, assume ...
3
votes
5
answers
1k
views
Brainf*** code golf challenge - write a Brainf*** program that searches for the first non-zero cell
The challenge is to write a brainf*** program that searches sequentially through memory for the first NON-zero cell.
The program should start somewhere in fairly low memory (there will probably be ...
16
votes
10
answers
2k
views
Brainf**k to Unary and Back
A language that is very useful in restricted source and other such challenges is Unary, a brainfuck derivative in which programs are written in with only one character. Your job is to write a program ...
15
votes
2
answers
964
views
Translate RoboCritters into Brainf***
RoboCritters (etymology) is a brand new esoteric programming language (don't bother searching for it, I just invented it). It's a variant of Brainfuck (BF), slightly more complex than the usual ...
9
votes
8
answers
1k
views
Convert Brainfuck to a Non-Golfing Language
Input:
Any Brainfuck program. This includes brainfuck programs with comments such as +++COMMENT[>+++<-]..
Output:
A program in one of the below languages that ...
11
votes
3
answers
836
views
Randomized Brainfuck Compiler
Joe is your average BF developer. He is about to check in his code changes to their repository when he gets a call from his boss. "Joe! The new client's machine is broken! The brainfuck interpreter ...