Skip to main content

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.

Filter by
Sorted by
Tagged with
150 votes
83 answers
26k views

Interpret brainfuck

Write the shortest program in your favourite language to interpret a brainfuck program. The program is read from a file. Input and output are standard input and standard output. Cell size: 8bit ...
Alexandru's user avatar
  • 6,134
35 votes
11 answers
16k views

Brainf*** Golfer

One of easiest code written by a programming language is a program printing sequence of characters (ex. "Hello, world!"). However, some esoteric programming languages like Brainfuck, even this ...
JiminP's user avatar
  • 3,452
14 votes
4 answers
2k views

Busy Brain Beaver

Write a brainfuck program of no more than 256 characters that takes as many steps as possible, but does not loop infinitely. The program may not take any input. More specifically: Assume an ...
Komi Golov's user avatar
32 votes
2 answers
7k views

Implement QuickSort in BrainF*** [closed]

As discussed in the Lounge room on Stack Overflow: if you can't implement the Quicksort algorithm given en.wikipedia.org/wiki/Quicksort in any language you have minimal knowledge of, you might want ...
Ronald's user avatar
  • 431
27 votes
5 answers
3k views

Tips for golfing in brainfuck

What general tips do you have for golfing in brainfuck? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to brainfuck (e.g. "remove ...
RAM's user avatar
  • 957
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 ...
Maltysen's user avatar
  • 25.7k
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 ...
Dennis's user avatar
  • 210k
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 ...
Martin Ender's user avatar
17 votes
9 answers
3k views

Write a brainfuck translator

In any programming or scripting language x, write a program that takes a valid brainfuck sourcecode from stdin and output, to stdout, the sourcecode of a program, written in language x, that would ...
user12205's user avatar
  • 9,008
15 votes
5 answers
3k views

Fastest Sort in BrainF***

After having implemented QuickSort in BrainF***, I realized it probably wasn't that quick. Operations that are O(1) in normal languages (like array indexing) are significantly longer in BF. Most of ...
AShelly's user avatar
  • 4,651
7 votes
8 answers
898 views

Brainf*** to tinyBF converter

You don't need to know these languages to participate. All necessary information has been provided in this question. You should write a program or function which given a brainfuck (BF) code as input ...
randomra's user avatar
  • 20.9k
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 (...
Doorknob's user avatar
  • 71.5k
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 ...
Mason's user avatar
  • 2,155
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....
Yeow_Meng's user avatar
  • 391
23 votes
4 answers
3k views

Minify Brainfuck

Your challenge is to minify Brainfuck code, according to these rules: Remove anything that is not one of +-><[].,. For any group of consecutive ...
Doorknob's user avatar
  • 71.5k
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 ...
Nick Rod's user avatar
  • 311
15 votes
3 answers
4k views

Bitwise Operators in Brainfuck

Your task is to create one brainfuck program for each of the following binary operators. Each program should take one or two 8-bit numbers (A and B) from input and calculate the specified operation: <...
captncraig's user avatar
  • 4,633
15 votes
2 answers
963 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 ...
Calvin's Hobbies's user avatar
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 ...
Galen Ivanov's user avatar
11 votes
8 answers
1k views

Generate a Brainf_ck program that outputs a string of given length

Your friend is trying to break into a vault that has a peculiar locking system: it requires a certain number of gentle knocks in a particular spot. Your friend discovered the number (which is in the ...
anatolyg's user avatar
  • 13.7k
11 votes
4 answers
1k views

Encoding an URL in brainfuck

Inspired by this question, your goal today is to encode an URL in brainfuck. My browser has been hacked! The location bar has been turned into a brainfuck interpreter. I need a program that turns an ...
orlp's user avatar
  • 39.1k
8 votes
1 answer
746 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 ...
user1502040's user avatar
  • 3,829
6 votes
1 answer
2k views

How to encode shortest brainf_ck strings

This is an interesting one. I have written a short program in objective-c to encode a string into a brainf_ck string, this is what it looks like: ...
6 votes
3 answers
1k views

Pi language interpreter

Introduction From Esolangs.org : Pi is based on the brainfuck language and uses the same instructions as it. Pi works by calculating pi digits and introducing errors in some random digits of ...
Michael M.'s user avatar
  • 12.1k
-4 votes
1 answer
912 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 ...
0xrgb's user avatar
  • 107