Introduction to BrainF*K Programming Language
Introduction to BrainFK Programming Language
Brainfuck (also known as brainf*ck, Brain Flex, Brainf**k, BrainF**k or Befunge) is an esoteric programming language created in 1993 by Urban Müller. It is a Turing-complete minimalistic language that consists of only eight simple commands and an instruction pointer. Brainfuck is designed to challenge and amuse programmers, and to inspire code golf golfers.
Brainfuck operates on an array of memory cells, also referred to as the tape, each initially set to zero. There is a pointer, initially pointing to the first memory cell. The commands, written as characters, are +-><
, []
, and .
. The command characters and their meanings are as follows:
+
: Increment the memory cell under the pointer.-
: Decrement the memory cell under the pointer.>
: Move the pointer to the right.<
: Move the pointer to the left.[
: Jump forward past the matching]
if the memory cell under the pointer is 0.]
: Jump backward to the matching[
if the memory cell under the pointer is nonzero..</
: Output the character with the ASCII value of the memory cell at the pointer.
Brainfuck has inspired the creation of many other esoteric programming languages, such as Befunge and Malbolge. It remains popular as an example of a Turing tarpit, making it a useful tool for teaching about computation theory and computational complexity.