Fireship · @fireship
Brainf**k in 100 Seconds
Uploaded December 10, 2021 · Length 2:10
Summary
brainfuck explained in 100 seconds, a minimal esoteric programming language that challenges the status quo.
- brainfuck
- esoteric programming language
- minimal language
- programming challenge
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
brain [ __ ] a minimal esoteric
- 0:02
programming language designed to make
- 0:03
your brain hurt it's Turing complete but
- 0:05
not designed to build actual software
- 0:07
it's more like a work of art that
- 0:09
challenges the status quo it was created
- 0:11
in 1993 by Swiss physics student Urban
- 0:13
Mueller where the goal was to create a
- 0:15
language with the smallest possible
- 0:17
compiler it was built for the amga 2.0
- 0:19
operating system and the compiler weighs
- 0:21
in at under 200 bytes a brain program
- 0:24
starts with a 30,000 by one-dimensional
- 0:26
array all values are initialized to zero
- 0:28
then it provides a movable point that
- 0:30
you can manipulate with eight different
- 0:32
commands use angle brackets to move the
- 0:34
pointer left or right by one cell at a
- 0:36
time then increment or decrement the
- 0:37
value in a Cell using plus or minus use
- 0:40
a period to Output the bite at the
- 0:42
Pointer's current location or use a
- 0:44
comma to accept input and store it at
- 0:46
the Pointer's current location and
- 0:47
finally use opening and closing brackets
- 0:50
to create a loop notice how brain Fu
- 0:52
doesn't require silly things like
- 0:53
variables functions and classes to get
- 0:55
started with brain [ __ ] delete your
- 0:57
operating system and install a migga OS
- 1:00
then create a file ending inbf which
- 1:02
stands for brain Fu any characters that
- 1:04
are not the eight I mentioned previously
- 1:06
will be ignored as a common at this
- 1:08
point we have an array with 30,000 8bit
- 1:10
numbers all set to zero to say hi mom
- 1:12
we'll need to set each number to its
- 1:14
corresponding asky character we can
- 1:16
increment the first cell then enter a
- 1:18
loop with an opening bracket for each
- 1:20
iteration of the loop we'll decrement
- 1:21
the current cell by five then use an
- 1:23
angle bracket to move one cell to the
- 1:25
right we'll increment that cell by three
- 1:27
then move back to the left and close the
- 1:29
loop the loop will will continue until
- 1:30
the original cell goes back to zero at
- 1:32
which point it will exit we now have a
- 1:34
value of 103 at index one we can move
- 1:37
the pointer to it increment it to 104
- 1:39
then use a period to Output it that
- 1:41
corresponds to the letter H in asky we
- 1:43
can increment it again to get 105 which
- 1:45
corresponds to the letter I now we
- 1:47
continue this process of manipulating
- 1:48
memory like cavemen until we output all
- 1:50
the characters that we need now to run
- 1:52
your code use rightclick copy and paste
- 1:54
it into one of the many online
- 1:56
interpreters congratulations you just
- 1:58
said hi to your mom and brain [ __ ] this


