Brainf**k in 100 Seconds

  Рет қаралды 7,309,204

Fireship

Fireship

Күн бұрын

Brainfuck is a minimal esoteric programming language. It provides a 30K 8-bit array that can be modified with 8 different characters.
#programming #compsci #100SecondsOfCode
🔗 Resources
Brainfuck History www.muppetlabs.com/~breadbox/bf/
Brainfuck Basics gist.github.com/roachhd/dce54...
Brainfuck Interpreter copy.sh/brainfuck/
🔥 Get More Content - Upgrade to PRO
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
🎨 My Editor Settings
- Atom One Dark
- vscode-icons
- Fira Code Font
🔖 Topics Covered
- Esolang or esoteric programming languages
- What is brainfuck used for?
- How to loop in brainfuck?
- How does brainfuck programming work?
- Who invented brainfuck?

Пікірлер: 4 500
@marty-mammel
@marty-mammel 2 жыл бұрын
my encephalon hurts!
@alek3y
@alek3y 2 жыл бұрын
yay!
@4444altan
@4444altan 2 жыл бұрын
Oh damn you were faster than me gg!
@Safeboot
@Safeboot 2 жыл бұрын
damn! well played.
@Fireship
@Fireship 2 жыл бұрын
🤯 WINNER! Well done. Send me an email or slack DM with your t-shirt size and mailing address.
@totallyrandom4664
@totallyrandom4664 2 жыл бұрын
@@Fireship but how do you know it's him that mailing you? Small doubt 😊
@user-he4ef9br7z
@user-he4ef9br7z 2 жыл бұрын
Invent a usable language and developers will complain about it. Invent an esoteric language and it will be appreciated forever.
@VivekYadav-ds8oz
@VivekYadav-ds8oz 2 жыл бұрын
Ties in really nicely to Bjarne Stroustrup's quote (creator of C++): _"There are only two types of languages, one that people complain about, and the other that no one actually uses"_
@pizzacheeseman2854
@pizzacheeseman2854 2 жыл бұрын
My only “popular” repo is for an incredibly shitty joke language compiler I wrote
@zaccstacc4568
@zaccstacc4568 2 жыл бұрын
Except the one that is complained about a ton is the most used language ( cough javascript cough python cough ), and the most appreciated one is barely ever used for anything practical lol
@sof4183
@sof4183 2 жыл бұрын
@mane i like it
@LuanHimmlisch
@LuanHimmlisch 2 жыл бұрын
@mane working with prototypes is more confusing than brainfuck. Like, why the hell 'this' returns me the window instead of the class?!
@nartallaxrwefwetg5627
@nartallaxrwefwetg5627 2 жыл бұрын
One thing to add - it's not just "turing complete", it's very close to original Turing machine, so no surprise it is turing complete.
@levyroth
@levyroth 2 жыл бұрын
No computer is really a complete Turing machine because we don't have unlimited memory space.
@multiarray2320
@multiarray2320 2 жыл бұрын
@@levyroth but the language is turing complete
@Kitulous
@Kitulous 2 жыл бұрын
@@levyroth yeah but Brainfuck is just a bunch of cells with a pointer, sounds awfully close to a Turing machine
@gJonii
@gJonii 2 жыл бұрын
@@levyroth Turing-complete in that, any turing machine X could be simulated, as long as we give the computer access to some M_X of memory, and t_X time. As long as you can expand the memory of the system somehow, it works well enough. Basically, instead of physical machine, when speaking of turing completeness or not, you tend to talk about hypothetical version of that machine that has Just Big Enough hard drive attached. It's a bit wacky but afaik it's still "here be dragons" type deal with memory-limited computation limits. You have busy beaver function and... Uh, that's it?
@VivekYadav-ds8oz
@VivekYadav-ds8oz 2 жыл бұрын
@@multiarray2320 Technically it's not Turing complete even in theory, because the specification restricts it to 30,000 cells, not any implementation.
@Adeyum64
@Adeyum64 Жыл бұрын
We had to program with brainfuck once in college. And trust me, it was so damn difficult to: 1. understand the language 2. not bursting out laughing everytime the professor said brainfuck
@Satgamer80d
@Satgamer80d 6 ай бұрын
lmao
@arkajyotipal6205
@arkajyotipal6205 4 ай бұрын
lmao
@CDev_10101
@CDev_10101 3 ай бұрын
lmao
@elisavbizau9909
@elisavbizau9909 2 ай бұрын
Hahahahahah
@dragon42850
@dragon42850 Ай бұрын
XDXDXDXDXDXDXDXD
@TheParrot5
@TheParrot5 7 ай бұрын
[ start loop ] end loop . print value ; save value > move cell pointer forward < move cell pointer backwards - decrement cell + increment cell
@AUTTP911
@AUTTP911 10 күн бұрын
Tnx
@etialpti9930
@etialpti9930 2 жыл бұрын
I tried to make a silly little program in bf and realized learning assembly would be much easier
@anthrxc
@anthrxc 2 жыл бұрын
fr doe
@renatosardinhalopes6073
@renatosardinhalopes6073 2 жыл бұрын
LOL
@tornadoreaper
@tornadoreaper 2 жыл бұрын
BRAINDUCK IS SO COOL OMFFFF
@BBWahoo
@BBWahoo 2 жыл бұрын
Boyfriend
@jaredvec5737
@jaredvec5737 2 жыл бұрын
Assembly doesn’t take too long to learn
@Mr.Coffee576
@Mr.Coffee576 2 жыл бұрын
So its like the Dark Souls of programming.
2 жыл бұрын
More like the "Getting Over It" of programming, designed to be minimal, hard, with one all purpose tool and once done you are left to ponder why you did you even start.
@luckyskull3531
@luckyskull3531 2 жыл бұрын
Nah, Dark Souls is a rhythm game this is just fuckin blasphemy haha
@fabrimuch
@fabrimuch 2 жыл бұрын
When a bug occurs you have one chance to rewrite your code to fix it but if it happens again the next time it's run the entire codebase is deleted forever
@vnie1988
@vnie1988 2 жыл бұрын
Dark Souls is written in Brain Fuck
@Abu_Ubaida9
@Abu_Ubaida9 2 жыл бұрын
the most just thing to do is to force dark souls developers to make darksouls only using bf, that would be fun to see, justice at it's peek
@DoctorPlasmaMC
@DoctorPlasmaMC Жыл бұрын
One of the things you didn't have time to explain is why -5, then +3. By starting with 1, one subtraction of 5 rolls over to 252. the second slot is incremented to 3. There's a lot of modulus arithmetic going on here. After 50 more loops (51 total) your values are 2 and 153. then subtracting 5 again rolls over again to 253 (and 156 now) another 51 loops and you're to 254. another 51 loops and you're to 255. another 51 loops and you're to 0 and end. At this point the second +3 slot will have added a total of 615, rolling over after 255 each time, so the desired output is reached, 103. What I haven't yet solved is how this "start 1, minus 5, plus 3" mod 256 algorithm to produce 103 was designed. There has to be a simple approach to say "I wish for this number" and pick 1,5,3 with a calculator.
@ThreeTrees475
@ThreeTrees475 Жыл бұрын
Translate.
@ThreeTrees475
@ThreeTrees475 Жыл бұрын
Math god.
@flaps_acd
@flaps_acd 11 ай бұрын
thanks i was wondering about how this works!
@abhi-ru3is
@abhi-ru3is 9 ай бұрын
Thank you for explaining it mods because I was losing my mind. I would just do like 10 + and then have it increment 10 times in the loop go to the first cell and decrement once. But this is cool.
@sharpcircle6875
@sharpcircle6875 9 ай бұрын
I didn't understand shit until I noticed that the whole 256 8-bit limit looped over when incremented or decrement at both sides of the interval lol. But that really masochistic way of inputting numbers and I'm pretty sure even assembler is more straight-foward :v
@JangoF12b
@JangoF12b Жыл бұрын
I have no idea what I just witnessed and no idea on how to comprehend it. Amazing work of art.
@eleah2665
@eleah2665 2 жыл бұрын
Sounds promising. I look forward to the full course.
@alemalohe
@alemalohe 2 жыл бұрын
😂
@armeli
@armeli 2 жыл бұрын
Well.. this is actually all there is to it :D
@Xyzgamershub
@Xyzgamershub 2 жыл бұрын
😂😂😂 Savage
@stretch654
@stretch654 2 жыл бұрын
Udemy probably has one.
@TwoLeggedTriceratops
@TwoLeggedTriceratops 2 жыл бұрын
You’ll be lookin forward alright, into the dark abyss of your inner sanctum.
@revenevan11
@revenevan11 Жыл бұрын
You should do one using the pikachu language! It just uses a few words that are things that pikachu says, like "pika" There's a mission statement about it being made based on pikachu language instead of human language, to make coding more accessible to pikachus, which are an underrepresented minority in the industry 😅 So a few years ago I made a simple program with it to add 2 inputted numbers together... and found out that the online interpreter for it was treating the input as strings, and just concatenating 1+1 to get 11... but iirc multiplication worked 🤦‍♂️ so basically the only place I found to run it was a flawed implementation that didn't follow the official pika syntax /standard 😫
@Ok-_-719
@Ok-_-719 Жыл бұрын
This language sounds really interesting. I looked it up and it’s called Pikalang
@aurelia8028
@aurelia8028 Жыл бұрын
lol
@alexgreene7110
@alexgreene7110 4 ай бұрын
I just looked this up and literally cried laughing. Thank you for this. ♥️
@HartleySan
@HartleySan Жыл бұрын
For about 12 microseconds, I felt the need to write an interpreter to convert a higher-level language to BF, and then I realized, wait! that's what compilers already do for machine code. Never mind!
@BurrritoYT
@BurrritoYT 5 ай бұрын
fr
@xWatexx
@xWatexx 4 ай бұрын
I thought the exact same thing
@leemokid
@leemokid Жыл бұрын
Got bored in highschool so I spent all year learning this language. By the end of the year, best I had was a text based tic-tac-toe where you entered a number 1-9 and it would then print the tic-tac-toe board in text. Repeat this 9 times and boom, a complete game. It was hundreds, if not thousands of lines of code to do it and very inefficient
@Jasomniac
@Jasomniac Жыл бұрын
Did python or C not exist at the time or did you just want to torture yourself?
@latermyfriend8934
@latermyfriend8934 Жыл бұрын
Sounds like you're pretty proud of that achievement.
@blacksabbath5300
@blacksabbath5300 Жыл бұрын
@@latermyfriend8934 he said at the end to do it inefficient... And uh, for brainfuck, that's actually pretty good.
@darkergen
@darkergen Жыл бұрын
bf is meant to hurt brains hence the name, bf
@TheMashmeister
@TheMashmeister Жыл бұрын
I want to Like this comment but cant. 420 likes is such a nice number to ruin
@fckngcheetah
@fckngcheetah 2 жыл бұрын
I'm fascinated by the simplicity of the language, though it gets obviously difficult when writing more than hello world 😂🔥
@randomsoul294
@randomsoul294 2 жыл бұрын
Well it's litteraly a Turing machine
@ZaifSenpai
@ZaifSenpai 2 жыл бұрын
someone made a Brainf**k compiler in Branf**k language.
@madmaseri
@madmaseri 2 жыл бұрын
few years ago i wrote a calculator in brainfuck, a lot of fun :D
@lucas.p.f
@lucas.p.f 2 жыл бұрын
@@madmaseri you should look for a therapist
@Aras14
@Aras14 2 жыл бұрын
I wrote a Fibonacci program (took one afternoon), a number to ascii converter and an ascii to number converter as the interpreter I used (Dcoder) could only output ascii. (over the course of a few weeks, a few hours at a time on my phone) It's hard and fun.
@eyesicecold
@eyesicecold 2 ай бұрын
2:00 is the funniest part in my opinion, because the bleep isn’t even. “This has been Brainfuc*”
@ibnbhai
@ibnbhai Жыл бұрын
as a person who did not understand a single word you said, i must say, you explained it rarther well
@21Blankenship
@21Blankenship 2 жыл бұрын
lol I didn’t ever expect you to cover this one
@CariagaXIII
@CariagaXIII 2 жыл бұрын
i expected this to be covered. eventually
@herrxerex8484
@herrxerex8484 2 жыл бұрын
@@CariagaXIII mooooooooMmmmooOo
@hugazo
@hugazo 2 жыл бұрын
I was expecting this one for april's fools
@TheBitenix
@TheBitenix 2 жыл бұрын
@@hugazo I am still making sure it is not April Fools
@VivekYadav-ds8oz
@VivekYadav-ds8oz 2 жыл бұрын
@@PalmDevs Cow language is uninspired. It's a textual replacement of brainf*ck. I just need to replace the tokens in my brainf*ck interpreter with the Moo variants and it works. It's still fun though 🚀🚀
@kaimba14
@kaimba14 2 жыл бұрын
he picked a perfect name for a physics student creating a programming language, but he did achieve his goal for creating language with smallest possible compiler so kudos for that
@norukamo
@norukamo 2 жыл бұрын
nice pfp
@tdpro3607
@tdpro3607 2 жыл бұрын
nice pfp
@BlazeYT_
@BlazeYT_ 2 жыл бұрын
nice pfp
@blazingphoenix7659
@blazingphoenix7659 2 жыл бұрын
Nice pfp
@ankitraj1466
@ankitraj1466 2 жыл бұрын
Nice pfp
@GillyTech
@GillyTech 8 ай бұрын
I have never seen a more clear explanation than this for brainf*ck. Bravo!
@si-arc
@si-arc Жыл бұрын
"manipulating memory like cavemen" got me. But also very accurate.
@rfn900
@rfn900 2 жыл бұрын
It all made sense when you mentioned it was invented by a physics student!
@glitch-dev4072
@glitch-dev4072 2 жыл бұрын
lol
@NicolaiWeitkemper
@NicolaiWeitkemper 2 жыл бұрын
As a physics student, I approve.
@TolkiCasts
@TolkiCasts 2 жыл бұрын
As readable as code written by physics majors indeed
@Indic4Zone
@Indic4Zone 2 жыл бұрын
ha! nice one lol
@forbiddenfursona
@forbiddenfursona 2 жыл бұрын
@@TolkiCasts lmaoooo
@fiquri8745
@fiquri8745 2 жыл бұрын
Programmers: why? Müller: why not?
@QCAlpha-212
@QCAlpha-212 2 жыл бұрын
As programmers with, theoretically, all the digital world at our mercy, the answer is always: Why not?
@breytonpabst1009
@breytonpabst1009 7 ай бұрын
Damn he really did say hi mom…
@kikimagill9967
@kikimagill9967 Жыл бұрын
this makes so much sense, might take a little time to get your head around but otherwise really simple
@kotokrabs
@kotokrabs 2 жыл бұрын
Until around 1:50 i thought this video is designed to f#ck your brain like some kind of illusion. But then I realized that he wasn't saying and showing some random stuff.
@Zeus_Was_Here
@Zeus_Was_Here 2 жыл бұрын
You made my day =))
@Kobekola
@Kobekola 2 жыл бұрын
Ironically if you don't understand operating systems this was still 100 seconds of brainf*ck
@shaansingh6048
@shaansingh6048 2 жыл бұрын
this is what it's like to not understand tech lol
@JustapErson
@JustapErson 2 жыл бұрын
The fact that people still use blatant clickbait is shameful.
@bleedinghearts4768
@bleedinghearts4768 2 жыл бұрын
LMAOOO ME TOO! I feel so stupid 🤣
@ThomasProsserZurich
@ThomasProsserZurich Жыл бұрын
Fun fact. There is a language called Whitespace which works a lot like Brainf**k just only uses - well - whitespace characters (line feeds, spaces, tabs, qou get the point, and you can probably imagine what a file of Whitespace code looks like). A colleague of mine and I were studying at the same school as Müller (the Swiss Federal Institute of Technology). My colleague chose to code a Brainf**ck to Whitespace converter. For purely scientific reasons of course.
@Revermb
@Revermb Жыл бұрын
god, why tf would anyone do that. sounds like fun, ima go do it aswell
@dripz_tlg3447
@dripz_tlg3447 Жыл бұрын
@@Revermb noooo ur gonna spend way too much time on it and then regret ever commitiong to such a monsterous project. anyways good luck
@-thanawat-8296
@-thanawat-8296 Жыл бұрын
holy
@maigoxx
@maigoxx Жыл бұрын
is the name an omori reference/j
@Paulo27
@Paulo27 Жыл бұрын
Is the converter written in bf or whitespace though?
@TonyNguyenTin
@TonyNguyenTin 11 ай бұрын
Thanks so much. Your channel is my inspiration
@Ramon314
@Ramon314 Жыл бұрын
Had to build this in assembly for school, was quite a fun exercise.
@SkyyySi
@SkyyySi 2 жыл бұрын
I think that bf could actually do with even less characters: Instead of using -, we could cause intentional overflows to reset a character.
@wwsciffsww3748
@wwsciffsww3748 2 жыл бұрын
And instead of using >, you could go right until it loops back around
@SkyyySi
@SkyyySi 2 жыл бұрын
@@wwsciffsww3748 Oh you're right. Since bf has a finite length (usually 30,000 bytes), that should also be possible
@__8120
@__8120 2 жыл бұрын
@@SkyyySi except I believe it is only Turing complete in the hypothetical case of having an infinite tape length
@__8120
@__8120 2 жыл бұрын
@Kanashimi except the whole point is that a language or concept is turing complete, not a physical implementation. You're right, nothing in the real world is technically turing complete
@__8120
@__8120 2 жыл бұрын
@Kanashimi correct. I'm just saying if you want it to be Turing complete you still need instructions to go both ways because looping around to the end isn't an option
@rhy_rhy_rhy
@rhy_rhy_rhy 2 жыл бұрын
Notice how he didn't do the usual "if you want a full course on this language, let me know in the comments below" for this one.
@eeriemyxi
@eeriemyxi 2 жыл бұрын
@@jon-h lmao
@cudaa73
@cudaa73 Жыл бұрын
November just started and this is what KZbin recommends me.
@vir.v2
@vir.v2 Жыл бұрын
why did my head started ACTUALLY hurting and itching while watching this video...
@fawzanfawzi9993
@fawzanfawzi9993 2 жыл бұрын
No way VSCode actually has syntax highlighting for BF.
@leoingson
@leoingson 2 жыл бұрын
Of course there are at least 3 extensions for exactly that, one has 9k downloads.
@shadamethyst1258
@shadamethyst1258 2 жыл бұрын
Syntax highlight extensions are quite easy to write, and brainfuck is like the easiest to parse, all you need are two regexes
@nemesisurvivorleon
@nemesisurvivorleon 2 жыл бұрын
not much to highlight
@reda29100
@reda29100 2 жыл бұрын
@@leoingson some people just want to see the world burn, the other 9k are smuggling lighters to the rest.
@slonkazoid
@slonkazoid 2 жыл бұрын
the markdown spec has it
@WalkinChristum
@WalkinChristum 2 жыл бұрын
I feel x10 smarter after watching this video, even if I don't understand much
@sibanbgd100
@sibanbgd100 Жыл бұрын
Dunning Kruger is that you?
@Japhnac
@Japhnac Жыл бұрын
0x10 is still 0
@Japhnac
@Japhnac Жыл бұрын
@David. ... how would 0x10 be 16
@Japhnac
@Japhnac Жыл бұрын
@David.
@ChraO_o
@ChraO_o 9 ай бұрын
It's actually easy! Thanks to this man explaining it to me, because i have no clue what it does.
@juliendagher4101
@juliendagher4101 Жыл бұрын
love this video, can you make one about prolog?
@ueberchild
@ueberchild 2 жыл бұрын
if you wonder how we got to 103 at 1:34: the first number is 1 before the loop, the second is 0, all unsigned 8-bit integers the loop is executed 205 times, it decreases the first by 5 and increases second by 3 every iteration so the first becomes (1 - 205 * 5) % 256 = 0 (allowing the loop to end), the second becomes (0 + 205 * 3) % 256 = 103
@edvinsjudins1109
@edvinsjudins1109 2 жыл бұрын
why is the loop executed 205 times?
@UQMD
@UQMD 2 жыл бұрын
why does the first cell undergo modulus?
@ueberchild
@ueberchild 2 жыл бұрын
@@edvinsjudins1109 because on every other iteration the first cell is not zero, which is required to stop the loop
@ueberchild
@ueberchild 2 жыл бұрын
@@UQMD all the cells are unsigned 8-bit integers, so they are overflowable, e.g. 253 + 3 is actually 0 (mod 256) 256 is 2^8
2 жыл бұрын
omg, thanks for that! I was staring at the screen thinking about it but I just couldn't believe I was in the right path
@oskrm
@oskrm 2 жыл бұрын
Idea: Service workers or caching in general, and maybe WPAs.
@israelssantanna
@israelssantanna 2 жыл бұрын
Written purely in brainf*ck?
@oskrm
@oskrm 2 жыл бұрын
@@israelssantanna What else, I'm sure it can be compiled to webassembly
@fairyanimal
@fairyanimal 2 жыл бұрын
*WAP
@sudoalex
@sudoalex 2 жыл бұрын
PWAs?
@akunformalitas
@akunformalitas 2 жыл бұрын
JSF*ck actually exists and might be more feasible
@JesusCarrero1991
@JesusCarrero1991 11 ай бұрын
I clicked the like button out of respect for whoever spend time learning that... but I don't want more videos about it. Knowing that exists is enough.
@babelette
@babelette 11 ай бұрын
I'm actually intrigued. I wish there was a market for this.
@MotoCzar
@MotoCzar 2 жыл бұрын
Interviewer: You have 30mins to solve. Which language will you program in? Me: _Brainfuck_
@Markomilicic012
@Markomilicic012 2 жыл бұрын
Interviewer: we need 4 wishes for this ono
@VivekYadav-ds8oz
@VivekYadav-ds8oz 2 жыл бұрын
What a coincidence lol! I was learning Rust and just built a Brainf*ck compiler yesterday. I also added a new operator _$_ that simply prints out the number by interpreting it as a number instead of an ASCII codepoint. This removes a lot of clutter found in brainf*ck code.
@ChaoticNeutralMatt
@ChaoticNeutralMatt 2 жыл бұрын
For some reason, I found this hysterical
@ThomasGodart
@ThomasGodart 2 жыл бұрын
You're going in the wrong direction. BF was invented to have as few commands as possible, and to be as hard to use as possible at the same time, while being theorically capable of doing anything. Hint: there is another version of BF with as few as 6 commands, because two of the 8 main BF commands can in fact be obtained with the 6 others. That's the way!
@nonadqs
@nonadqs 2 жыл бұрын
@@ThomasGodart Stop telling people to respect the simplicity of an esoteric, joke language
@drewsarkisian9375
@drewsarkisian9375 2 жыл бұрын
@@nonadqs You miss the meta-point. The language isn't meant to be used, so what's the point of adding to it? Creating a MINIMAL language that could theoretically do things IS the point, and the joke.
@Alche_mist
@Alche_mist 2 жыл бұрын
@@drewsarkisian9375 That said, nowadays, this - the thing OP and many other did - is what is Brainf*ck used the most as of now. That is, for people to learn the basics about compilers and to have a defined problem for training a very particular skillset and ideas. As that, I see OP's work - yes, even including the clutter-removing expansion - as an absolute win. It's not honoring the _original_ idea of the language, but it very much is honoring OP's intent with the concept.
@3_14pie
@3_14pie 5 ай бұрын
"manipulating memory like caveman" is the best thimg i've heard in a while, i'm actually laughing outloud
@catoons1824
@catoons1824 Жыл бұрын
This will be my end goal to master this
@lisaschuster9305
@lisaschuster9305 2 жыл бұрын
This is much smarter and more interesting than I would originally have thought. Thanks for the video! It was insightful.
@00euclid
@00euclid 2 жыл бұрын
Had to write a whole python script just to check what happened with the first letter over there, didn't know with subtractions it goes back to 255 after 0 and with additions, after 255 it goes back to 0, obviously due to overflow. def test_255(num: int) -> int: if num < 0: return 256 + num elif num > 0: return num else: return 0 def main() -> None: num: int = 1 counter: int = 0 while num != 0: num = num - 5 print(num) num = test_255(num) counter = counter + 1 print(f"Iterations --> {counter}") if __name__ == "__main__": main() ## Output: 205 So the loop runs 205 times and it adds 3 to each time leading to 615, which after accounting for the overflow leaves 103.
@Grimtheorist
@Grimtheorist 2 жыл бұрын
Thank you, I was trying to figure this out with just a calculator, heh..
@No.ah.
@No.ah. 2 жыл бұрын
@@Grimtheorist Thanks for your help guys, standing here with the calculator and a Python-script open. :')
@TheHotIcedTea
@TheHotIcedTea 2 жыл бұрын
this was the comment I was looking for, thank you!
@John14073
@John14073 2 жыл бұрын
thank you for doing the legwork - i wasn't 100% certain at first how he was able to reach 103 like that
@TuringMachine001
@TuringMachine001 2 жыл бұрын
You can also do modular arithmetic to solve this. If k is the number of times the body of the loop runs, then 1 - 5 k = 0 mod 256. Plugging this into WolframAlpha or solving by hand, you get k = 205 mod 256, so the loop runs 205 times.
@kazumakanjifreak3010
@kazumakanjifreak3010 Жыл бұрын
I-ve never even written anything in BrainFuck before and now my hurt brains look justing video at this!
@haryormedayjoshua281
@haryormedayjoshua281 Жыл бұрын
Nice one. Waiting for someone to write a software with this
@TheRonpe
@TheRonpe 2 жыл бұрын
This language has potential to be a successor for JavaScript.
@Markomilicic012
@Markomilicic012 2 жыл бұрын
no nonononononononoon no
@softwarelivre2389
@softwarelivre2389 Жыл бұрын
JSFuck is a valid sucessor, though
@RinkieGeintie
@RinkieGeintie 2 жыл бұрын
fun fact: this language is so simple that it has been recreated in a Geometry Dash level
@Flo-rq8by
@Flo-rq8by 2 жыл бұрын
What the hell?! 😂 But does that mean you can program inside the game?
@RinkieGeintie
@RinkieGeintie 2 жыл бұрын
@@Flo-rq8by No they just used the triggers
@alexandruracz9995
@alexandruracz9995 2 жыл бұрын
@@RinkieGeintie I mean he did create a GD programing language as well
@RinkieGeintie
@RinkieGeintie 2 жыл бұрын
@@alexandruracz9995 yeah thats true
@Skywalker2016GD
@Skywalker2016GD 2 жыл бұрын
Ah yes, brainfugd
@aurelia8028
@aurelia8028 Жыл бұрын
I like how the bleep is slightly delayed
@mitsuzawa
@mitsuzawa Жыл бұрын
that was sick, i hope they add some DLC for brainfug
@thatfriendwhomovedaway6889
@thatfriendwhomovedaway6889 2 жыл бұрын
That code at the end is probably "Never gonna give you up" because it looks like it would match the length of the code, considering that each letter that should be printed needs a lot of brackets and other stuff in the code.
@ng1n369
@ng1n369 2 жыл бұрын
This is a wise man right here
@Mostbee
@Mostbee 2 жыл бұрын
But actually, the video says it's only outputted by a dot and you can store a value and make loops to avoind longer code too, so double dots means 2 indentical letters one after another... There's more than 50 dots there, so maybe it's a long text
@thatfriendwhomovedaway6889
@thatfriendwhomovedaway6889 2 жыл бұрын
@@Mostbee I mean never gonna give you up is a long text in its full length
@Mostbee
@Mostbee 2 жыл бұрын
@@thatfriendwhomovedaway6889 Well, that's true
@NareshBharasagar
@NareshBharasagar 2 жыл бұрын
Executed the first few letters, it begins like "what a".
@NourArt02
@NourArt02 2 жыл бұрын
Every other programming language: "Hello World!" Brain F**k: "Hi Mom" Edit: Thanx Red Point for "pointing" that out.
@redpoint6870
@redpoint6870 2 жыл бұрын
It's "Brain" how did you mess it up?
@noobracerz6964
@noobracerz6964 2 жыл бұрын
@@redpoint6870 His brain really got f**ked that's why he messed it. 😆
@PT_X10
@PT_X10 Жыл бұрын
Watched it in 2x and i must say it truly did exactly what it was supposed to with my brain.
@J-Crash
@J-Crash Жыл бұрын
someone needs to write a game with this
@Revermb
@Revermb Жыл бұрын
Advertisement: we're looking for brainfuck developers benefits include: free pizza, great pay, a gun to release yourself of the pain and suffering
@RayDragonfly
@RayDragonfly 2 жыл бұрын
For those having trouble understanding how the loop works I've illustrated it: We have two cells: [0][0] ^ We're incrementing the first cell by 1: [1][0] ^ Then we enter the loop and decrement the first cell 5 times: [0][0] ^ [255][0] ^ [254][0] ^ [253][0] ^ [252][0] ^ Then we move one cell to the right: [252][0] ^ We then increment the cell 3 times: [252][1] ^ [252][2] ^ [252][3] ^ Then we move one cell to the left: [252][3] ^ Now we repeat the loop until the first cell becomes 0, both cells have to underflow/overflow several times: Add 256 when underflowing (Going below 0) Subtract 256 when overflowing (Going above 255) [252][3] ^ (Loops 50 times) [-250][+150] [2][153] ^ [253][156] ^ (Loops 50 times) [-250][+150] [3][51] ^ [254][53] ^ (Loops 50 times) [-250][+150] [4][203] ^ [255][206] ^ (Loops 51 times) [-255][+153] [0][103] When the first cell equals 0 we exit the loop You can apply these principles to all of the loops shown to find the correct values!
@MarkO-tu9dh
@MarkO-tu9dh 2 жыл бұрын
you a real one for this, I understand it now haha
@muhammadhaque8118
@muhammadhaque8118 2 жыл бұрын
Here is another way to arrive at a similar result, except that it yields [103][0] instead of [0][103] : >++++++++++[-]
@majorgeneralrahul6298
@majorgeneralrahul6298 2 жыл бұрын
Thanks
@caterpillow
@caterpillow 2 жыл бұрын
hey i know u
@LGseeker
@LGseeker 2 жыл бұрын
That makes a lot of sense now
@sadeepaalwis5938
@sadeepaalwis5938 2 жыл бұрын
at this point i wouldn't be surprised if another language pops out like "Holy $#!t" and fireship did a 100 second video about it
@JustPlayerDE
@JustPlayerDE 2 жыл бұрын
technically there is HolyC which can be understood as "Holy $#!t" if said weird
@softwarelivre2389
@softwarelivre2389 2 жыл бұрын
@@JustPlayerDE Is that the language used to create TempleOS?
@NozomiClips
@NozomiClips 2 жыл бұрын
@@softwarelivre2389 yep
@imaginaoYouTubesoquecomarrobas
@imaginaoYouTubesoquecomarrobas 2 жыл бұрын
btw there are other weird languages with weird or funny names from the likelyhood of brainf**k in terms of unconventional design, that are known under the name of "esoteric programming languages", or "esolangs" for short. I would like to highlight APL (litterally an acronym for "A Programming Language", and is one of the first esolangs ever being created), the Shakesperian Programming Language (a language whose scripts can also be interpreted in a really weird play) and Piet (an image-based esolang that allows you to draw art in any place that isn't code)
@sadeepaalwis5938
@sadeepaalwis5938 2 жыл бұрын
@@imaginaoKZbinsoquecomarrobas omg
@_Tzebra_
@_Tzebra_ 9 ай бұрын
I wrote some 8088 assembly where first you had to clear the screen by placing black backgeound and black foreground and then actually writing character bytes to the video memory to show it on screen and i have to use interrput hooking (was required). So I actually had to modify the interrupt vector table. As far as I see, BF looks easy in comparison
@user-si5ik5xf3m
@user-si5ik5xf3m 6 ай бұрын
The code is less obvious than assembly. Languages try to make logic of the algorithm more understandable by humankind. While this thing makes it more confusing.
@_thresh_
@_thresh_ 8 ай бұрын
wow this is actually very simple yet so complex to humans
@baggier
@baggier 2 жыл бұрын
now im willing to buy fireship pro to find more content about this language
@oskrm
@oskrm 2 жыл бұрын
I see a bright future for this language, 2022 trending
@vaisakhkm783
@vaisakhkm783 2 жыл бұрын
Because HR s are getting dummer... We have to make more apps like ticktok to get job...
@goteer10
@goteer10 2 жыл бұрын
There is no more content, only programs
@enkryp
@enkryp 2 жыл бұрын
- What is the simplest programming language? - BF, it has only six simple commands and nothing more
@junosoft
@junosoft 2 жыл бұрын
8
@vaisakhkm783
@vaisakhkm783 2 жыл бұрын
When I was in school l,I actually thought why I can't make a programming language that has minimum number of symbols.... So people don't need to study a lot... Then only i came to know about this lang and understand it will be a f..Up language.
@exedeath
@exedeath 2 жыл бұрын
The simplest one is unary, its basically this one, but first symbol is converted to 0, the second is now 1, the third is 2 and this goes on. After you have all those numbers in order, you add a 1 before the first number and convert this huge number to unary ( basically 3 is 111, 5 is 11111, 2 is 11 and this goes on). This one has just one symbol. There is also a golfcode one (forgot the name), instead of converting to unary you dont, and there are an extreme amount of golf code langueges, one called language 1, other called language 2, and this goes on and one. if the language you are compiling is "language 12345", by compiling a empty file from this language it will compile the program with the code 12345, if the code is not empty, it will compile brainfuck.
@legiterally2902
@legiterally2902 Жыл бұрын
I noticed that I liked this video before watching this, I don’t remember watching this, the video hasn’t even started and my brain is already fucked
@chillinduck7007
@chillinduck7007 Жыл бұрын
I have no idea what i just watched but i like it
@bruhgamer317
@bruhgamer317 2 жыл бұрын
great way to get into making compilers and interpreters, even as a total novice you can get something working in a single day
@sebastiangudino9377
@sebastiangudino9377 2 жыл бұрын
I remember seeing a pretty fun implementation using only c macros
@ozenthelewdable5427
@ozenthelewdable5427 2 жыл бұрын
From making compilers to becoming an actual brainfuckery physicist.
@-Burb
@-Burb 2 жыл бұрын
Yeah I was able to create a brainfuck interpreter in literally 20 minutes. I thought it would be a fun little challenge to work on for a few hours but didnt realize just how easy it would be.
@RexVelde
@RexVelde 2 жыл бұрын
Love this kind of vids! Esoteric languages are always fun, so I would love to see more videos covering them.
@tusharthegreatest176
@tusharthegreatest176 Жыл бұрын
i like how beep sound come after you say it clearly
@redtrek1239
@redtrek1239 Жыл бұрын
I’ve never been more terrified in my life than when I discovered this video
@tamaskovacs-ajtai7489
@tamaskovacs-ajtai7489 2 жыл бұрын
I didn't know what I wanted for christmas. You just gave me a perfect surprise. Always interested how this works, but never took the time and focus to do it myself. Thank you very much!
@thegreatbambino3358
@thegreatbambino3358 Жыл бұрын
I had a school project where I had to output all the lyrics of 99 bottles of beer on the wall using brainf*ck and then give a presentation on the language. It was actually quite fun to talk about making functions that generated the brainf*ck code for me in I think perl.
@toastsandwich8553
@toastsandwich8553 Жыл бұрын
this seems so simple yet complicated the name is accurate.
@ivanc.6064
@ivanc.6064 Жыл бұрын
The "i wonder what this code does" code snippet at the end looks like my next tribal tattoo
@ksjitendra18
@ksjitendra18 2 жыл бұрын
Recruiter: Why you have mentioned hello world program in your resume? Me: Sir I wrote that in BrainF**k R: You are hired
@buddhavskungfu
@buddhavskungfu 2 жыл бұрын
That actually seems like a legit idea.
@JoshingYouu
@JoshingYouu 2 жыл бұрын
So happy you made a video on this. It’s been one of my favorite languages for but now and is what got me into esoteric languages in the first place.
@nikplaysgames4734
@nikplaysgames4734 9 ай бұрын
This programming language was recreated in Geometry Dash! I beat the level, it was actually a really fun puzzle level (basically the level was that he recreated brainfugd, as well as a compiler for it and a way to put in inputs and outputs. So essentially recreated everything. Then the level teaches the user how to use the language, and makes the user solve certain puzzles with the language (for example - outputting the word "hello," which there are many solutions to)
@auvidas3803
@auvidas3803 Жыл бұрын
thnks for the brainfk lesson!
@1.Y.6
@1.Y.6 2 жыл бұрын
Loving your videos man, keep up the good work!
@apteryx
@apteryx 2 жыл бұрын
I'm guessing the code at the end is something like "never gonna give you up"
@arandomuser1723
@arandomuser1723 2 жыл бұрын
no it is "what a free t-shirt? be the first person to comment "my encephalon hurts!" "
@matsbjnnes366
@matsbjnnes366 Жыл бұрын
I’m just now realising the calculator I wrote in COW used a strangely similar syntax. I suppose COW is just BF with the +- and operators swapped out for variations of Moo.
@aethar2750
@aethar2750 2 жыл бұрын
Things like this make me appreciate how much abstraction and normal understandable code helps our tiny little human brains
@tikemyson4126
@tikemyson4126 Жыл бұрын
You can’t convince me this guy is not just waffling
@ChrisLegend27
@ChrisLegend27 Жыл бұрын
I can't unsee and i can't forget what i have witness this fine morning
@TheComedyGeek
@TheComedyGeek 2 жыл бұрын
Thanks for this! I've always wanted to know more about this esoteric bit of programming trivia.
@jaysonbunnell8097
@jaysonbunnell8097 2 жыл бұрын
Y’know what though, this is way more interesting than I thought. I may try writing in brainf**k sometime edit: wrote a brainf**k interpreter in JS (still working on the input to be portable). Super fun challenge. 10/10!
@Dr.Schnizzle
@Dr.Schnizzle 2 жыл бұрын
Great! Now write a JS interpreter in brainf**k ;P
@64TNT
@64TNT Жыл бұрын
My brain is starting to literally hurt after watching this
@toothpeak5430
@toothpeak5430 Жыл бұрын
the fact that I no absolutely nothing about computers and I can slightly understand how to make a sentence with this surprises me.
@armeli
@armeli 2 жыл бұрын
Creating an interpreter for bf in any language you start learning is a fun beginner project. I had no prior experience with coding when I took a beginner class in C#. After a few lessons when we had covered how loops work I made myself an bf interpreter. The most complicated thing is how to handle the [ and ] signs correctly, but it doesn't require much knowledge in coding and it's more like a logic puzzle.
@iyviish
@iyviish 2 жыл бұрын
Fireship is one of the very few channels i follow to learn computers. It is very unique and fun too. Keep going and do great things ❤️
@tinymarcspider
@tinymarcspider Жыл бұрын
Props to people who used captions
@thefoundation3489
@thefoundation3489 Жыл бұрын
After this, I can confirm. My brain has been fucked.
@notmilenakos
@notmilenakos 2 жыл бұрын
i like how he completely missed censoring at 2:00
@notatallbruh2011
@notatallbruh2011 10 ай бұрын
"this has been brainf%$# in 100 seconds"
@kirkkork
@kirkkork 2 жыл бұрын
Awesome! My head hurts trying to figure this out, but this helps a lot, thank you!
@theultimatekeko
@theultimatekeko Жыл бұрын
my brain started hurting at 0:06 i am not even joking
@okaberintorouwithagun
@okaberintorouwithagun Жыл бұрын
I got 4 seconds in and I already had to rewind to fully understand what was just said
@Ady-rt1yu
@Ady-rt1yu 2 жыл бұрын
Amazing timing, I was just going to start using this on a project.
@MarkB..
@MarkB.. 2 жыл бұрын
I'm going to forget all of this in about 20 seconds but thank you for teaching me this
@DiegoFernandez-cy3fr
@DiegoFernandez-cy3fr Жыл бұрын
Mom: Hey, why you don't play with Urban anymore? Urban: ...
@mr.randomly2799
@mr.randomly2799 6 ай бұрын
im inclined to learn this now
@DonVigaDeFierro
@DonVigaDeFierro 2 жыл бұрын
I love those 2-minute videos that explain something so simply that I can think "Oh, yeah, I totally got this. Easy as hell." as long as I don't have to actually do the thing...
@benc589
@benc589 Жыл бұрын
This world is rapidly passing away and I hope that you repent and take time to change before all out disaster occurs! Belief in messiah alone is not enough to grant you salvation - Matthew 7:21-23, John 3:3, John 3:36 (ESV is the best translation for John 3:36) if you believed in Messiah you would be following His commands as best as you could. If you are not a follower of Messiah I would highly recommend becoming one. Call on the name of Jesus and pray for Him to intervene in your life - Revelation 3:20. Contemplate how the Roman Empire fulfilled the role of the beast from the sea in Revelation 13. Revelation 17 confirms that it is in fact Rome. From this we can conclude that A) Jesus is the Son of God and can predict the future or make it happen, B) The world leaders/nations/governments etc have been conspiring together for the last 3000+ years going back to Babylon and before, C) History as we know it is fake. You don't really need to speculate once you start a relationship with God. Can't get a response from God? Fasting can help increase your perception and prayer can help initiate events. God will ignore you if your prayer does not align with His purpose (James 4:3) or if you are approaching Him when "unclean" (Isaiah 1:15, Isaiah 59:2, Micah 3:4). Stop eating food sacrificed to idols (McDonald's, Wendy's etc) stop glorifying yourself on social media or making other images of yourself (Second Commandment), stop gossiping about other people, stop watching obscene content etc. Have a blessed day!
@dziolex2190
@dziolex2190 Жыл бұрын
@@benc589 stop baiting
@jannes6666
@jannes6666 2 жыл бұрын
Not designed to create actual software... How dare you XD
@jannes6666
@jannes6666 2 жыл бұрын
@@jon-h But can it run Crysis?
CSS in 100 Seconds
2:20
Fireship
Рет қаралды 535 М.
Assembly Language in 100 Seconds
2:44
Fireship
Рет қаралды 1,5 МЛН
1 класс vs 11 класс (неаккуратность)
01:00
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 118 #shorts
00:30
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
00:19
Khaby. Lame
Рет қаралды 35 МЛН
how to never write bug
7:20
Fireship
Рет қаралды 823 М.
BrainF*ck Programming Tutorial - Can You Code in BrainF*ck?
27:33
Tech With Tim
Рет қаралды 57 М.
A.I. Learns to play Flappy Bird
7:46
Code Bullet
Рет қаралды 14 МЛН
7 Things No Programmer Ever Wants to Hear
5:16
Fireship
Рет қаралды 1,7 МЛН
I tried 10 code editors
10:28
Fireship
Рет қаралды 2,8 МЛН
How to get rich as a solo software developer - The Ultimate Guide
8:51
10 weird algorithms
9:06
Fireship
Рет қаралды 1 МЛН
Programming Language Tier List
0:55
Conner Ardman
Рет қаралды 2,5 МЛН
Lua in 100 Seconds
2:24
Fireship
Рет қаралды 2 МЛН
Как я сделал домашний кинотеатр
0:41
RICARDO
Рет қаралды 1,5 МЛН
Чем отличается OLED от AMOLED?
0:43
Не шарю!
Рет қаралды 750 М.
A Comprehensive Guide to Using Zoyya Tools for Photo Editing
0:50
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 47 МЛН
Приехала Большая Коробка от Anker! А Внутри...
20:09
РасПаковка ДваПаковка
Рет қаралды 84 М.
Xiaomi Note 13 Pro по безумной цене в России
0:43
Простые Технологии
Рет қаралды 1,8 МЛН