Donut-shaped C code that generates a 3D spinning donut

Поділитися
Вставка
  • Опубліковано 3 лют 2025

КОМЕНТАРІ • 5 тис.

  • @lexfridman
    @lexfridman  4 роки тому +9694

    I spend some time every day learning something new. I thought it might be cool to occasionally make short videos like these on things I come across that to me are beautiful, whether they are basic or advanced, in machine learning, math, computer science, programming, psychology, etc. Hope it's of value or at least fun for some of you.

    • @firesoul453
      @firesoul453 4 роки тому +49

      Whats your method to try to learn something new every day?

    • @lawrencegatley6157
      @lawrencegatley6157 4 роки тому +25

      love it man thanks for sharing, this is computer science meets poetry

    • @TheMazyProduction
      @TheMazyProduction 4 роки тому

      Lawrence Gatley thanks I also have a video about it on my channel. ☺️

    • @ShepherdTeam6
      @ShepherdTeam6 4 роки тому +3

      You're the man Lex

    • @JotaZamith
      @JotaZamith 4 роки тому +1

      Very cool! Keep doing a good job, the chanel keeps improving 👍🏼

  • @GregoryTheGr8ster
    @GregoryTheGr8ster 4 роки тому +14834

    The minimalism of ASCII art is still fascinating and intriguing.

    • @phizlip
      @phizlip 4 роки тому +63

      Ok

    • @meenahh
      @meenahh 4 роки тому +224

      I have no experience in coding whatsoever and I just got this in my recommended, so for me this isnt minimalistic and is complex. I’m pretty sure im embarrassing myself lol

    • @michal147147
      @michal147147 4 роки тому +38

      YES, play Dwarf Fortress

    • @GregoryTheGr8ster
      @GregoryTheGr8ster 4 роки тому +18

      @@michal147147 Absolutely! I need to play Dwarf Fortress. I have heard about it, but I still have not played it. Why am I procrastinating like this?

    • @jeremyszpicki491
      @jeremyszpicki491 4 роки тому +4

      It’s witchcraft. Heresy.

  • @interstellarbeatteller9306
    @interstellarbeatteller9306 4 роки тому +4862

    "Your theory of a Donut-shaped Universe is intriguing, Homer"
    - Stephen Hawking

    • @halinalane1426
      @halinalane1426 4 роки тому +157

      Hawking inviting timetravellers to a party he advertised months later is the greatest party in the history of parties.
      No one came, he sat alone all night, possibly eating donuts.

    • @Yolwoocle
      @Yolwoocle 4 роки тому +81

      There's actually a serious scientific theory about the universe being shaped like a hyper-torus, or a 4 dimensional donut

    • @hseldon524
      @hseldon524 4 роки тому +5

      He stole it!

    • @interstellarbeatteller9306
      @interstellarbeatteller9306 4 роки тому +8

      @@Yolwoocle A closed loop system like a torus can be stretched & twisted onto a figure 8 - the symbol for infinity?
      -It's all impossible to grasp so a donut shaped Univese seems as plausible as a flat, ever expanding one does to a layman like me!

    • @interstellarbeatteller9306
      @interstellarbeatteller9306 4 роки тому +19

      @@halinalane1426 I'm thinking on another timeline somewhere there's a room with Stephen Hawking and 6000 timetravellers all squashed together....

  • @randomness928
    @randomness928 4 роки тому +18854

    Man talking about coding and using terminology
    Me: hehe look at the donut go

    • @quinnivia
      @quinnivia 4 роки тому +477

      Haha doughnut go whoosh

    • @fcantil
      @fcantil 4 роки тому +347

      nooooo you can't just watch the video without paying attention!!!!!😤😤😤😤

    • @TheYukejen
      @TheYukejen 4 роки тому +142

      you reminded me of children playing games on my tablet until i asked them where do games come from
      they said "dont games just appear in ipads"
      i told them it wasnt an ipad it was a tablet but they seemed pretty dissapointed when i said people make them
      now whenever i tell children im making a game with the Unity Game Engine they look confused
      they will grow up soon

    • @nafreal
      @nafreal 4 роки тому +117

      @@fcantil haha attention span go brrrrrr

    • @kaexewires7531
      @kaexewires7531 4 роки тому +12

      this could be a new meme, damn, everything can be a meme nowadays

  • @supershasha
    @supershasha 2 роки тому +101

    This guy sounds like he's dead inside but also sounds like he really enjoys what he's doing.
    My spirit animal

  • @supernova2958
    @supernova2958 4 роки тому +6545

    It's beautiful. I've looked at this for five hours now.

    • @noahnolte7288
      @noahnolte7288 4 роки тому +22

      Hello Tom Haverford.

    • @mohamedmusamustafa3324
      @mohamedmusamustafa3324 4 роки тому +33

      The code or the animated donut?

    • @bbroadcast3919
      @bbroadcast3919 4 роки тому +49

      I don't understand don't you have any thing better to do? There are many other things that are more intressting then looking at this donut

    • @noahnolte7288
      @noahnolte7288 4 роки тому +90

      @@bbroadcast3919 bruh. its a quote from a tv show

    • @ytg6663
      @ytg6663 4 роки тому +3

      Get a job lame

  • @artfuldoc
    @artfuldoc 4 роки тому +519

    Every minute I spend on this channel leaves me with valuable knowledge and expanded curiosity. Thank you.

    • @oohboi2750
      @oohboi2750 4 роки тому +11

      That’s the beauty about it. You always want to know more the more you get knowledge !

    • @MrQwerty2524
      @MrQwerty2524 4 роки тому +10

      Cool! I just leave confused

    • @user-lk8ep6nh1u
      @user-lk8ep6nh1u 4 роки тому +2

      Lmao you’re worrying about the wrong things in life if this “animation” is knowledgeable to you get a real job kids

    • @MadeofStarsMusic
      @MadeofStarsMusic 4 роки тому

      Every minute I spend on this channel leaves me feeling like a complete dumb ass but I thoroughly enjoy ya Lex. Love ya brotha!

    • @user-lk8ep6nh1u
      @user-lk8ep6nh1u 4 роки тому

      Logic_is_ Debatable yeah 12 year olds know how to code, it’s now an elementary skill. Go on telling yourself that simple flash animation is important LOL

  • @gaysonorthotdaughta
    @gaysonorthotdaughta 2 роки тому +800

    it took me a while to realize it wasn’t pixels that the spinning donut was made out of. the fact it was only tiny keyboard symbols changing their positions on the screen is amazing!!

    • @somethingelse4424
      @somethingelse4424 2 роки тому +23

      Well technically positions on the screen changing the keyboard symbols they display to give the impression of movement of the symbols to give the impression of a singular object moving in a coherent direction, but I get your point.
      A lot of ASCII art is just a jpeg or png put through a filter and then saved as a jpeg or png, which just defeats the concept... In my opinion. But this IS pretty cool, since it is actually simulating/modeling the geometry of a torus and generating actual text. In theory this program could also output a txt file that is basically a flip book of this animation, and you could write a script or program that reads it and plays the animation. I think that would be cool as a project.

    • @wearethewearethewearethhe
      @wearethewearethewearethhe 2 роки тому +24

      I see you are part of the new generation who will never understand computers since they do everything automatically.

    • @jacobwilson8275
      @jacobwilson8275 2 роки тому +69

      @@wearethewearethewearethhe kinda rude to say. More people than ever understand computers, with amazing resources to do everything from scratch, however, way more people can also get into things casually as well.

    • @Brassard1985
      @Brassard1985 Рік тому +1

      It’s ASCII characters.

    • @Brassard1985
      @Brassard1985 Рік тому +36

      @@wearethewearethewearethhe Gate keeping is not cool, nor is it productive in any way. Do better.

  • @arc2444
    @arc2444 4 роки тому +2661

    "With syntax highlighting"
    You mean with sprinkles

    • @KSPAtlas
      @KSPAtlas 4 роки тому +8

      @@Prokesh beanut

    • @SHOTbyGUN
      @SHOTbyGUN 4 роки тому +17

      That is the best thing I've read today :)

    • @Magnamhut
      @Magnamhut 4 роки тому +14

      He may have outsmarted you, but you outsmarted his outsmarting

    • @Noel_FGC
      @Noel_FGC 4 роки тому +2

      ...

    • @Jake_Josh
      @Jake_Josh 4 роки тому +4

      When you change that 999 to 1K.
      Chuckles: This comment is useless.

  • @Mr.Magnetix
    @Mr.Magnetix 4 роки тому +6137

    The dude: Tells us exactly how they created this complex rotating torus
    Me: ʰᵃʰᵃ ᵈᵒⁿᵘᵗ ˢᵖᵉᵉⁿ

    • @mastergamerwasd5508
      @mastergamerwasd5508 4 роки тому +39

      How did you make those letters small like what

    • @Dtomper
      @Dtomper 4 роки тому +53

      @@mastergamerwasd5508 They's called superscript letters. You can type your text and copy paste it on this site: smalltext.io/

    • @mastergamerwasd5508
      @mastergamerwasd5508 4 роки тому +14

      @@Dtomper Ooohhh thx!

    • @bubaaaaaaaaa
      @bubaaaaaaaaa 4 роки тому +36

      ʸᵉᵃʰ ᵍᵒ ˢᵖᵉᵉⁿ

    • @roadkill236
      @roadkill236 4 роки тому +23

      *ʰᵃʰᵃ ʸᵉˢ*

  • @lemlem35
    @lemlem35 4 роки тому +636

    This is my favorite thing about humanity; the desire to create something so pointless and yet so interesting and thought provoking that doesn't really add any value to our collective knowledge base but makes us feel nice for a little bit

    • @emanuelneagu14
      @emanuelneagu14 2 роки тому +46

      that's basically any art and it is great indeed

    • @dizzylimme
      @dizzylimme 2 роки тому +10

      I agree, art is basically an illusion, especially surrealism and abstraction, where it can be perceived differently by every viewer. Even cooking can be tasted differently by different people. If you think about it, art can be comforting, but sort of pointless. So, why do we make it if it’s pointless? Art can help with many skills, and it can involve math and other things into it. In a way, almost every perceived emotion means nothing. If you forgot to do your homework or something, you’re probably not going to get physically hurt. The most pain you’ll feel is the one you cause yourself.

    • @youtubeuser206
      @youtubeuser206 2 роки тому

      @@dizzylimmetell me more please

    • @Helix_22
      @Helix_22 2 роки тому +6

      What is those thoughts and feelings that come from pointless things lead to things that do create value to humanities collectivness.
      Thereby putting a great deal of value on these types of things that are both pointless in their own standing but very much important in their overall view.

    • @mihahh1016
      @mihahh1016 2 роки тому +1

      @Alex the only poinless thing here is your comment. Which is not even interesting.
      p.s. if you dont see a point it doesnt mean something is pointless. Gaining and sharing knowledge isn't pointless. You dont start learning computer graphics with OpenGL, unity etc.. You have to learn the basics before you can create something revolutionary.
      This has nothing to do with "feeling nice for a little bit"

  • @Palendrome
    @Palendrome 2 роки тому +677

    I want someone to build a full 3d game using these techniques

  • @eskimo8383
    @eskimo8383 4 роки тому +2149

    What my friends code : *full adventure games, complete with a full map, weapons, bosses, and more*
    What i code :

    • @isaac10231
      @isaac10231 4 роки тому +300

      Dude don't kid yourself, if you're doing stuff like this that's still really impressive.

    • @realcartoongirl
      @realcartoongirl 4 роки тому +7

      ya

    • @HandledToaster2
      @HandledToaster2 4 роки тому +195

      You have friends who code games? And you code mathematical demonstrations?

    • @anshikasingh6555
      @anshikasingh6555 4 роки тому +4

      I got you 50

    • @Jun.Suzuki
      @Jun.Suzuki 4 роки тому +1

      I can only make models and stuff :/

  • @LoneVII7
    @LoneVII7 4 роки тому +1061

    I have no idea what the hell is going on, but it's cool to watch

    • @jimmydishkawnt
      @jimmydishkawnt 4 роки тому +11

      Its making me hungry

    • @necrobyte7451
      @necrobyte7451 4 роки тому +1

      It’s spinning both directions is what’s interesting

  • @AAvfx
    @AAvfx 4 роки тому +2698

    *This code take me back to the Commodore 64 days! Man, we knew how to party with sophisticated animations!* 😂

  • @kenedi987
    @kenedi987 2 роки тому +7

    This spinning 3D ASCII Donut has got to be the peak of computer science accomplishments. Thank you for this, Lex, this will change my life for the better.

  • @jaslikeart
    @jaslikeart 2 роки тому +8275

    I love how society just collectively decided that any circulars shape with a hole in the middle is a donut

    • @emanuelneagu14
      @emanuelneagu14 2 роки тому +931

      it's not a ring. Not a tire. Not a damn toilet paper roll. It's a donut. 💯

    • @戴劭名-z8p
      @戴劭名-z8p 2 роки тому +474

      Or you can refer it as it's formal name which no one in the world would call: torus.

    • @whenwhen2284
      @whenwhen2284 2 роки тому +166

      It is a torus, so calling it a donut wouldn’t be that misleading

    • @emanuelneagu14
      @emanuelneagu14 2 роки тому +143

      @@whenwhen2284 yeah it's just 3 letters wrong out of 5, not that wrong

    • @screamindog8772
      @screamindog8772 2 роки тому +52

      @@戴劭名-z8p really? I thought it gave off pisces vibes

  • @LTV_inc
    @LTV_inc 3 роки тому +614

    I recently found this channel. As an engineer I appreciate your understanding of geometry but as someone who owned an original IBM PC I am impressed by your knowledge of basic. I truly am blessed to have lived in this interesting time. I wish more people had your intellect and curiosity. I truly enjoy your conversations. Thank you!

  • @katomiccomics202
    @katomiccomics202 4 роки тому +3334

    *Why model a donut in Blender when you can just program it.*

    • @BURN-ADDiCT
      @BURN-ADDiCT 4 роки тому +195

      I can't do either.... I can only eat it 😭😭

    • @Jun.Suzuki
      @Jun.Suzuki 4 роки тому +33

      I can only make an actual blender

    • @Jun.Suzuki
      @Jun.Suzuki 4 роки тому +26

      in blender

    • @patatizm7710
      @patatizm7710 4 роки тому +28

      @@BURN-ADDiCT i dont have money to eat it lmao

    • @patatizm7710
      @patatizm7710 4 роки тому +16

      i can just look at it o_o

  • @SCOP_
    @SCOP_ 2 роки тому +27

    This is truly one of the donut ever

  • @leaf56448
    @leaf56448 4 роки тому +3075

    Somebody : you don't need math for programming
    Him : hold my donut

    • @HandheldGamingHQ
      @HandheldGamingHQ 4 роки тому +227

      fr tho i don't know why people say we don't need
      to be good at maths to be good at programming
      like, if you wanna write good AI and ML code you need to be good at data structures and calculus
      if you wanna write good video game code you need to have good knowledge in physics and their mathematics
      even web development requires good mathematical thinking when writing interactive stuff

    • @leaf56448
      @leaf56448 4 роки тому +101

      Definitely. Although most of the time we don't use math in programming but having good mathematical skills will help you program better.

    • @ananttiwari1337
      @ananttiwari1337 3 роки тому +67

      Then that "Somebody" is very smartn't. Programming is literally logic, you NEED to use maths. If your code is just simple "do this do that" without any maths, most people would place that under "coding", any programming by definition would require some sort of maths...

    • @sitter2207
      @sitter2207 3 роки тому +35

      True, I've been trying to create games with plenty of game engines as hobby. Programming language and creating logic is pretty simple stuff but is very limited. The moment you want to do even a little bit advanced stuff you need math / physics. Same goes for web dev. I love coding but hate maths so that's a bit weird

    • @herrherr2086
      @herrherr2086 3 роки тому +43

      its fascinqting how those useless vectors and matricies from school now actual make sense and fascinate me because i started programming. i really wanna understand this, i wish i paid more atention back in school.

  • @Kanerade
    @Kanerade 4 роки тому +781

    "In 2020 we will have flying cars"
    2020: ASCII donut go spinny spin

    • @VanellamonSpring
      @VanellamonSpring 4 роки тому +4

      Brrrrrr

    • @nuutine
      @nuutine 4 роки тому +7

      it would be weird that if we would have flying cars now but not spinnin donuts

    • @human.earthling
      @human.earthling 4 роки тому +1

      We have both now.

    • @jjuniorc2
      @jjuniorc2 4 роки тому

      Maybe in 3020 flying cars could be reality

    • @inigo137
      @inigo137 4 роки тому +1

      The internet is way cooler than flying cars imo

  • @bloodypommelstudios7144
    @bloodypommelstudios7144 4 роки тому +770

    Reminds me of a dream I had when I was a small child learning Qbasic some time around '93. I was showing a programmer my shitty games then he showed me how it was done. After about 20 seconds of furious typing he had a 3d spinning ascii skull on the screen with a very similar style to this.

    • @fear7356
      @fear7356 3 роки тому +25

      He made it in 20 seconds??
      Edit: didn't notice it was a dream lol

    • @bloodypommelstudios7144
      @bloodypommelstudios7144 3 роки тому +92

      @@fear7356 It was like a cross between hackers in movies furiously typing and live shader coding but on 90s hardware. Eventually it ended up with an animated rotating 3d scene in ascii.

    • @AhmedMahmoud-tv9vw
      @AhmedMahmoud-tv9vw 3 роки тому +68

      @@fear7356 it's a dream

    • @mew7wo
      @mew7wo 3 роки тому +2

      No shot

    • @saphrone9749
      @saphrone9749 3 роки тому +6

      @@Shaze1 i used to read word-up magazine

  • @johnran6015
    @johnran6015 2 роки тому +3

    I have zero idea about anything you explained here but the donut is hypnotic.

  • @NY_Mapper
    @NY_Mapper 4 роки тому +36

    My friends all went out to a party without me and I’m watching this.

  • @wardrich
    @wardrich 3 роки тому +276

    I love the "because I can" attitude of that programmer. ♥️♥️

    • @jacksonsmith2955
      @jacksonsmith2955 2 роки тому +1

      Look up the IOCCC if you want to see way more insane BS written in unreadable C. There's a flight simulator in the shape of a plane as well.

    • @wardrich
      @wardrich 2 роки тому +1

      @@jacksonsmith2955 thanks! Into the rabbit hole I go 😂

  • @gingsSon
    @gingsSon 4 роки тому +239

    Part II: Dipping the donut in a cup of coffee
    🍩 -> ☕️

    • @Mastermindyoung14
      @Mastermindyoung14 4 роки тому +5

      @@aBraveNewNormal Klein bottle*

    • @DreamskyDance
      @DreamskyDance 4 роки тому

      You mean doing that in coffee-script.. ?

    • @BURN-ADDiCT
      @BURN-ADDiCT 4 роки тому

      The code is shaped like C dripping into Java

    • @gnomer30015
      @gnomer30015 4 роки тому

      Part 3: a vampire donut machine.

    • @RenShin97
      @RenShin97 4 роки тому

      part 3: stardust crusaders XD

  • @Giga.s
    @Giga.s Рік тому +1

    10 years worth of program in movies: *Makes a crazy codes that hacks the entire country*
    10 years worth of program irl: *DONUT*

  • @harizshahhamin6324
    @harizshahhamin6324 4 роки тому +383

    "On the left is a spinning donut"
    Yes, we can tell that it is spinning sir

    • @MageAtYou
      @MageAtYou 4 роки тому +44

      "On the left is a donut"
      It's actually a spinning donut sir

    • @Casteray
      @Casteray 4 роки тому +7

      Its for blind people
      Change my mind

    • @ciasteczkowymix4347
      @ciasteczkowymix4347 4 роки тому

      @@Casteray *changing ur mind*

    • @kingpiggins292
      @kingpiggins292 4 роки тому

      I want spinning banana

    • @OrangeC7
      @OrangeC7 4 роки тому +1

      I thought it was a jumping gummy bear

  • @CronyxRavage
    @CronyxRavage 4 роки тому +18

    That's really fascinating Lex, thank you. I first got "online" in 1986 with a 300 baud coupling modem, connecting to BBSes. I've gotten to watch all this happen in real time. To me, this represents an interesting "what if" window into a world where we didn't unlock 3d acceleration when we did, but instead, ASCII / ANSI game graphics got more robust with clever, simple coding like this. Imagine an ASCII first person shooter. I also feel like a camera filter that turns the world into ASCII art like that might make it easier for AI to see the world, as it would effectively be reading a text array. Less bandwidth and processing power required.

  • @6Twisted
    @6Twisted Рік тому +2

    My favorite part of programming is putting in some simple instructions and getting something complex back.

  • @johnwalker5614
    @johnwalker5614 4 роки тому +8252

    "It's amazing to think what great and exciting things people will be doing with PC's in 30 years."
    - Bill Gates, 1989

    • @valencehockey1668
      @valencehockey1668 3 роки тому +526

      *Donut-shaped C code that generates a 3D spinning donut*

    • @c0nc3ntr8d6
      @c0nc3ntr8d6 3 роки тому +141

      Quoting Bill Gates didn’t age well.

    • @dimitar.bogdanov
      @dimitar.bogdanov 3 роки тому +243

      @@c0nc3ntr8d6 his divorce has nothing to do with this though

    • @simonfarre4907
      @simonfarre4907 3 роки тому +46

      And just like Elon Musk he was talking out of his damn ass. He wasn't a genius then and he isn't now. Neither is Elon, although, Elon is arguably even dumber. PC is not what amazing things is done on. Actually, very little has changed on what we do on PCs in the last 30 years, with some graphics fidelity upgrade. Most of the amazing stuff is done on other technology and hardware.

    • @dimitar.bogdanov
      @dimitar.bogdanov 3 роки тому +215

      @@simonfarre4907 Do you use your computer for anything resource-intensive? Do you even have a clue what Bill meant? He's saying the stuff we do today is impressive compared to what we were doing 30 yrs ago, not that anything substantial would have changed like you're implying

  • @TheNewton
    @TheNewton 4 роки тому +19

    Need more of that format - 0:26 algorithmic steps leading into 0:56 code implementation.
    So few videos that to do deeper dives on these neat little pieces of code.

  • @noprofile
    @noprofile 4 роки тому +495

    I love how you say “hope this is a value, fun and something you enjoy.” With no enthusiasm whatsoever bahaha

    • @saturninedroid3920
      @saturninedroid3920 3 роки тому +5

      lol true

    • @sanjacobs6261
      @sanjacobs6261 3 роки тому +18

      Once you watch enough Lex, you'll slowly come to realize that that intonation is the sound of him having a great time

    • @D3r3k2323
      @D3r3k2323 3 роки тому +18

      He takes having fun very seriously!

    • @yadaKiKhula
      @yadaKiKhula 3 роки тому +15

      I hope everyone goes back to speaking like this cause that is normal. Nowadays everyone “screams” and is always “super excited” about every small thing.

    • @jammingpython8986
      @jammingpython8986 3 роки тому +9

      @@yadaKiKhula It is ok to speak in any way. There is no normal way to speak, each have their own way to speaking. Some may express their feelings loudly or some may be quiet about it. It is ok to speak loudly or softly.

  • @Spate_Fissionfire
    @Spate_Fissionfire 2 роки тому +159

    Somebody needs to set the spinning donut to an 8-bit rendition of around the world.

    • @yuyuridolly
      @yuyuridolly 2 роки тому

      your comment is my command ua-cam.com/video/XQn28L1ZhKg/v-deo.html

  • @JackLe1127
    @JackLe1127 4 роки тому +940

    Normal people: While(true){...}
    Woke man Lex Fridman: for(;;){...}

    • @talesamaral3744
      @talesamaral3744 4 роки тому +50

      @@DanielNyong it was a joke

    • @luizg8034
      @luizg8034 4 роки тому +1

      @@DanielNyong woosh

    • @DJstarrfish
      @DJstarrfish 4 роки тому +29

      200% bespoke: x: {...} goto x;

    • @humm535
      @humm535 4 роки тому +18

      true intellectuals: for (;; …);

    • @DJstarrfish
      @DJstarrfish 4 роки тому

      @@humm535 Can't have expression-less statements (e.g. an "if" statement or a variable declaration) in that part of the "for" loop. If you only used expressions, you could separate them with commas, though.

  • @Octopixel40
    @Octopixel40 4 роки тому +217

    "It's all donut?"
    "Always has been."

  • @ValerioRhys
    @ValerioRhys 4 роки тому +356

    My coding resume: "I have the code to create a moving donut!"

  • @MustyYew
    @MustyYew Рік тому +1

    He sounds so happy

  • @promindplayer2468
    @promindplayer2468 4 роки тому +416

    Him: how he created the complicated code to make such a 3d donut shape
    Me: _you're making me hungry_

    • @Noel_FGC
      @Noel_FGC 4 роки тому +5

      its not that complicated, its just compact, its really just 5th grade math with a text readout

    • @glarms6355
      @glarms6355 4 роки тому +5

      @@Noel_FGC You do relize this comment was intendet to be funny. So ıt doesnt realy matter

    • @denizdemir9255
      @denizdemir9255 4 роки тому +2

      @@Noel_FGC there's always that guy

    • @Noel_FGC
      @Noel_FGC 4 роки тому

      @@glarms6355 you do realize my reply wasn't intended to be serious right? so it doesn't really matter

    • @glarms6355
      @glarms6355 4 роки тому +1

      @@Noel_FGC Well I didnt get the joke apertnly

  • @angelseijas6955
    @angelseijas6955 4 роки тому +1896

    So this is why aliens don't visit us...
    *We're way to powerful*

    • @stardast4576
      @stardast4576 4 роки тому +28

      they had us in the first half not gonna lie

    • @liguow
      @liguow 4 роки тому +20

      Everyone expects aliens to be strong, they may be more advanced OR the opposite.

    • @spaceclips1404
      @spaceclips1404 4 роки тому +19

      too*

    • @mikethegamedev
      @mikethegamedev 4 роки тому

      I made this 100 likes

    • @jiahow6642
      @jiahow6642 4 роки тому +10

      @@spaceclips1404 next up on supergenius:

  • @misci26
    @misci26 2 роки тому +6

    Shading and everything, this is astounding

  • @Hgggkkkjdjdjeje
    @Hgggkkkjdjdjeje Рік тому +10

    This is cool! I love how you let everyone know how to do this. It‘s much easier than some people think. Along with that, it can be fun to mess around with and study programming.

  • @BURN-ADDiCT
    @BURN-ADDiCT 4 роки тому +171

    I really thought my C assignment (printing the sastantua pyramid of a given input size) is hard... I'm realizing now that maybe I'm too dumb to be amazing

    • @adeled8833
      @adeled8833 4 роки тому +3

      Ecole 42?

    • @fillerbunnyninjashark271
      @fillerbunnyninjashark271 4 роки тому +77

      Realizing you're dumb is the first step in understanding your limitations and working passed them, lol... We're all dumb. Most refuse to acknowledge it

    • @datboi1861
      @datboi1861 4 роки тому +26

      @@fillerbunnyninjashark271 This was painfully motivational.

    • @teh_jibbler
      @teh_jibbler 4 роки тому +5

      This program is more math than program.

    • @BURN-ADDiCT
      @BURN-ADDiCT 4 роки тому +3

      @@teh_jibbler yes..... but I suck at both though

  • @_nom_
    @_nom_ 4 роки тому +204

    None of the comments I've read seem to comprehend how complicated and amazing this feat is.

    • @quantumpotential7639
      @quantumpotential7639 4 роки тому +32

      Because we have soy running thru our brains.

    • @tristan6509
      @tristan6509 4 роки тому +14

      This is how 3d used to be done 35 years ago
      It's the most primitive way to render 3d objects, modern 3d rendering are a million times more difficult than this...

    • @kirayoshikage4057
      @kirayoshikage4057 4 роки тому +46

      @@tristan6509 except the physics and math behind the model that we rely on when building render engines hasn't changed over past 35 years, if anything, it has gotten easier because most of the job is done in hardware and you clearly aren't the one building said hardware.

    • @thecakeredux
      @thecakeredux 3 роки тому +10

      It's not exactly complicated, what makes this so cool is the golfing aspect.

    • @ThatStupidIdoitMatt
      @ThatStupidIdoitMatt 3 роки тому +4

      k;double sin()
      ,cos();main(){float A=
      0,B=0,i,j,z[1760];char b[
      1760];printf("\x1b[2J");for(;;
      ){memset(b,32,1760);memset(z,0,7040)
      ;for(j=0;6.28>j;j+=0.07)for(i=0;6.28
      >i;i+=0.02){float c=sin(i),d=cos(j),e=
      sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*
      h*e+f*g+5),l=cos (i),m=cos(B),n=s\
      in(B),t=c*h*g-f* e;int x=40+30*D*
      (l*h*m-t*n),y= 12+15*D*(l*h*n
      +t*m),o=x+80*y, N=8*((f*e-c*d*g
      )*m-c*d*e-f*g-l *d*n);if(22>y&&
      y>0&&x>0&&80>x&&D>z[o]){z[o]=D;;;b[o]=
      ".,-~:;=!*#$@"[N>0?N:0];}}/*#****!!-*/
      printf("\x1b[H");for(k=0;1761>k;k++)
      putchar(k%80?b[k]:10);A+=0.04;B+=
      0.02;}}/*****####*******!!=;:~
      ~::==!!!**********!!!==::-
      .,~~;;;========;;;:~-.
      ..,--------,*/

  • @denialsaysno
    @denialsaysno 4 роки тому +69

    I feel like I was only recommended this because of all the JJBA vids I watch

    • @mineland8220
      @mineland8220 4 роки тому +3

      Haha dio go muda
      Diavolo go-

    • @bonnie6153
      @bonnie6153 4 роки тому +5

      I was looking for that comment

    • @toastyp
      @toastyp 4 роки тому +4

      Kakyoin....

    • @koerga
      @koerga 4 роки тому

      nandato?! samee

  • @preetchakrani9814
    @preetchakrani9814 Рік тому +7

    It is unbelievably awesome. The understanding you have about math and as well as coding can't be said. Respect!!!

  • @DiamondSan7
    @DiamondSan7 4 роки тому +231

    People who do coding stuff: hmm, interesting
    Everyone else: hee hoo donut go wee haha

  • @jonesiejoneserton2218
    @jonesiejoneserton2218 4 роки тому +42

    Donuts and coffee with Lex
    how I'm spending my afternoon

  • @norik1616
    @norik1616 4 роки тому +10

    It work! Just had to add the libs:
    #include
    #include
    #include
    #include

  • @Lichen8404
    @Lichen8404 4 роки тому +93

    This guy explaining computer science while 99% of us is just here like
    HHEEHOO SP I N DO N UT

  • @JayAyers
    @JayAyers 4 роки тому +27

    Please share more stuff like this Lex! My mind is lighting up trying to figure out how all of this works.

    • @spacewad8745
      @spacewad8745 4 роки тому +3

      You might wanna check out a talk titled ‘The Art Code’ on youtube by Dylan Beattie.

  • @DomPiotr85
    @DomPiotr85 4 роки тому +7

    It works like a charm on my Raspberry Pi 4b. To make it run on linux based machine, add this includes:
    #include
    #include
    #include
    #include
    and compile it like this:
    cc donut.c -o donut -lm

  • @bbdeathgrips
    @bbdeathgrips 2 роки тому

    I’ve seen this video before and UA-cam continues to recommend it to me everyday

  • @joefuentes2977
    @joefuentes2977 3 роки тому +15

    This is the nerdiest flex I've seen in a while and is very impressive!

    • @destiny_02
      @destiny_02 3 роки тому

      @@الإسلامدينالحق-خ5ت first find out why are YOU here ?

  • @zpxyz
    @zpxyz 4 роки тому +24

    This is the deep intellectual content I subscribe to you for

  • @zakutoDow2
    @zakutoDow2 4 роки тому +128

    This was fun, more of these bite size content.

  • @lunastoonas7101
    @lunastoonas7101 2 роки тому +1

    Can’t believe you made Rengoku in 3D

  • @ScienceANDesign
    @ScienceANDesign 4 роки тому +4

    Thank you Lex, I ran to read the blog when you posted it for the first time on Twitter, this code is like pearl, tiny and beautiful, a piece of fine knowledge jewelry. BTW, great channel, I follow all your updates from Buenos Aires, Argentina.👍🏻🇦🇷🇺🇸

  • @RSSpeacemaker
    @RSSpeacemaker 2 роки тому +10

    I've been watching your channel as I do this exact sort of thing every day, so it absolutely blows me away when something I listen to at my leisure enters the same mental space as a tutorial I find on the internet! Really cool by the way.

  • @Ridlay_
    @Ridlay_ 2 роки тому +1

    I like how someone will do this just because they can. Beautiful.

  • @linuxd
    @linuxd 3 роки тому +33

    Incredible. This is exactly what I'm looking forward to learning.
    How to explore my mind and imagination using programming

  • @kingside22
    @kingside22 4 роки тому +573

    Him: freaking Albert Einstein
    Me: hehe donut go brrrrrrrrr

    • @lenidev
      @lenidev 4 роки тому +1

      Not that it matters but I feel it should be said, I'm the 69th like.

    • @fgrey-
      @fgrey- 4 роки тому

      @@lenidev i can't like now ;(

    • @dim7ay
      @dim7ay 4 роки тому +7

      Even Einstein couldn't make a spinning donut with symbols.

    • @thedeathstar420
      @thedeathstar420 4 роки тому

      @@lenidev nice

    • @feritperliare2890
      @feritperliare2890 4 роки тому +1

      @@dim7ay I mean einstein wasn't into this sort of stuff but honestly I think if you gave him like a weak to study the fundamentals he'd achieve at least a more primitive version of the donut one that doesn't simulate light is all

  • @AdamSalehx
    @AdamSalehx 4 роки тому +564

    And me in blender🌚💔

    • @AdamSalehx
      @AdamSalehx 3 роки тому +8

      @boy lasagna hmm.. years* my laptop ain't that strong damn..

    • @gaeljs9493
      @gaeljs9493 3 роки тому +3

      Default cube squad here

    • @indrakusuma7427
      @indrakusuma7427 3 роки тому

      Donut lord

    • @ajemajh
      @ajemajh 3 роки тому +1

      @boy lasagna my first project is a car, big mistake

    • @doctahjonez
      @doctahjonez 3 роки тому

      @@ajemajh Mine was a plane like 3 years ago lol

  • @TheDoof0412
    @TheDoof0412 2 роки тому +1

    Idk why but for some reason i had the Freebird riff playing in my head when i saw the donut spin

  • @gushlak3983
    @gushlak3983 2 роки тому +3

    i hope this will forever be lex’s most viewed video

  • @goodguy7883
    @goodguy7883 4 роки тому +15

    Blender guru: hold my coffee cup

  • @ahaquer153
    @ahaquer153 4 роки тому +34

    Your videos have a way of reminding me that I need to get my shit together

    • @5358-i4s
      @5358-i4s 4 роки тому

      elck3 Get your shit together.

  • @leixor
    @leixor 2 роки тому +2

    al form in his minimal form is a sphere or a derivate of a perfect donut

  • @bobbill7879
    @bobbill7879 4 роки тому +19

    Me at the beginning of video: oh that looks interesting
    Me at the end: Doughnut. *ROTAT E*

  • @alexanderhough9175
    @alexanderhough9175 4 роки тому +159

    Lex: explaining insane, complicated coding based on complex mathematics
    Me: hehe donut go brrrrrrr

    • @matthewhunter2443
      @matthewhunter2443 4 роки тому +6

      0:44
      1. Make a 3d circle
      2. Make it spin like a coin
      3. Make it move like a coin (make it move around and not just in one spot)
      4. Use some code to make the donut look 3d when it’s flat
      5. Use different things to make it darker and brighter(the scale at the bottom goes from darkest to lightest.
      6. Use some more code to make it seem like there is a light source. This tells it when to be darker and lighter
      Hope this was simple enough

    • @Stettafire
      @Stettafire 3 роки тому

      Far from insane and complicated, it's not too bad. As you gain more coding knowledge what once seemed overwhelming becomes less so. Eventually once you know how to break problems down into their component parts nothing is truly insurrmountable

  • @xanderz101
    @xanderz101 4 роки тому +7

    this dude: spinning computer donut
    1.1 million people: *yes*

    • @xanderz101
      @xanderz101 4 роки тому +2

      @Y K dude it’s a spinning donut not a Reddit post

  • @Hmfirestormz
    @Hmfirestormz 2 роки тому

    ive been recomended this video almost every other day for 2 years now.. FINE ILL WATCH IT LEX!!!

  • @blurryink115
    @blurryink115 4 роки тому +25

    Me: ooo spinning donut
    *starts showing the math and steps*
    Me: aight imma head out

    • @sunlight9541
      @sunlight9541 4 роки тому +5

      everyones gangsta until maths came in

    • @syrm7_959
      @syrm7_959 4 роки тому +3

      Best joke so far

  • @itsthequenchiest5072
    @itsthequenchiest5072 2 роки тому +3

    This takes Portgas D. Ace fanart to a whole new level

    • @milkuetea
      @milkuetea 2 роки тому

      Ace fans 🤝 Rengoku fans
      Donut

  • @BatVal
    @BatVal 4 роки тому +7

    Me: has to study for finals
    UA-cam recommendations: donut go spin spin

  • @6thstWinston
    @6thstWinston 2 роки тому

    I know nothing about computers but im learning. I bet as I keep learning about computers I will really appreciate this vid. I'll come back to it in about 1year.

  • @tomtomdelasmontanas1100
    @tomtomdelasmontanas1100 4 роки тому +10

    This is it, the moment we have been waiting for, the combination of the first form of human art and the lastest knowledge we learned , the beauty of the 2d and 3d donut and the functionality of the code.

    • @lockks
      @lockks 3 роки тому

      its just a friking ascii donut

    • @pearz420
      @pearz420 3 роки тому

      Nothing about this involves any recent tech or knowledge at all.

  • @noompsieOG
    @noompsieOG 2 роки тому +4

    This pretty much demonstrates reality

  • @sviatoslavs.1305
    @sviatoslavs.1305 4 роки тому +4

    Alright, UA-cam, why I am watching a video almost at midnight about donut, written in a language that I used to learn back in college but no one uses it nowadays?
    UA-cam: "I don't know, just watch lmao."

  • @lemon_orchid5637
    @lemon_orchid5637 2 роки тому

    I have no clue what is happening but im living for it

  • @alex-n4j
    @alex-n4j 3 роки тому +7

    that's why I want to degree in computer science, to draw a freaking spinning donut

  • @whistletoe
    @whistletoe 4 роки тому +10

    love the inventiveness and simplicity of this!

  • @technoeggnog
    @technoeggnog 4 роки тому +11

    "I'd like you to tell me the difference in these two images."
    The images: 3d spinning donut & Sonic the Hedgehog rings
    Me: "They are the same."

  • @XenoTravis
    @XenoTravis 2 роки тому +1

    Next step is to make a program that takes a program and wraps it into a 3d donut and compiles it.

  • @jeremywong4235
    @jeremywong4235 4 роки тому +4

    Next video: Spinning donut that generates C code

  • @Asleepkat
    @Asleepkat 4 роки тому +5

    Him : " *I used the donut to make the donut.* "

  • @allwar3854
    @allwar3854 4 роки тому +6

    I entered this video wanting to see an spinning donut and i exited it feeling bad with myself

  • @BananaGamerOver
    @BananaGamerOver 2 роки тому +1

    Finally watched this video. Algorithm ain't leaving me alone

  • @happytrailsgaming
    @happytrailsgaming 2 роки тому +4

    Have no idea what I'm looking at

  • @alberthgsm
    @alberthgsm 2 роки тому +8

    Hi friend,
    First of all, thank you for posting your code.
    It was by chance that I stumbled upon it. It allowed me to discover facets of C programming that I did not know. Especially regarding syntax.
    I compiled it for Win7 and it worked badly. I had a Screen Scroll. All I had to do was remove the escape sequences and call the system("cls") function to get a result like the one in your video. This will allow me to try to code small animations in console mode.
    Thanks again....

    • @andryrincon5584
      @andryrincon5584 2 роки тому

      Hello, could you help me, I don't know how to do it: 'v

    • @alberthgsm
      @alberthgsm 2 роки тому

      Hi Andy. Maybe. But you didn't do what exactly?

    • @CamtaroChannel
      @CamtaroChannel Рік тому

      add code "system ("CLS");" inside int() main{}

  • @Contemelia
    @Contemelia 4 роки тому +60

    Dennis Ritchie: "You won't believe what people will be able to do with C language in the future!"
    Future:

    • @cattocs
      @cattocs 4 роки тому

      Unbelievable, right?

    • @ImACatNotAMouse
      @ImACatNotAMouse 4 роки тому

      People in 1980's: "In the future people will be able to do everything using graphical interfaces"
      People in 2020's: git, docker, npm, linux...
      People in 1980's: *"Are we a joke to you?"*

  • @metalpipelol69
    @metalpipelol69 2 роки тому +1

    I like how the code is the donut itself

  • @jacqueslangner311
    @jacqueslangner311 4 роки тому +5

    This is great. I love all the stuff from the Obfuscated C Code Contest.

  • @ThatGuy-Jai
    @ThatGuy-Jai 2 роки тому +5

    Awesome doughnut tutorial

  • @yourbestfriendinshooters3088
    @yourbestfriendinshooters3088 4 роки тому +24

    Here the comment you're not searching for:
    Kakyoin

  • @TymBenn
    @TymBenn 2 роки тому

    "There is the donut and the hole, you gotta keep you eye on the donut and not the hole" - David Lynch

  • @_S.H_
    @_S.H_ 3 роки тому +21

    Reminds me of my early years of programming when I programmed a walking man and a rotating pyramid, among many others!

  • @TheHuskyK9
    @TheHuskyK9 4 роки тому +16

    No one:
    UA-cam: Wanna see a spinning code donut?
    Me: Hell yeah

  • @ckisamazing
    @ckisamazing 4 роки тому +78

    nobody:
    quarantine: Donut-shaped C code that generates a 3D spinning donut

    • @feritperliare2890
      @feritperliare2890 4 роки тому

      To be fair he's cheating on the last part of the code with the comment part

    • @sreea2365
      @sreea2365 3 роки тому

      @@feritperliare2890 Ah, I didn't see that. But can't you purposefully stretch the code and rearrange it to get a donut? Guess it would take a lot of time.

    • @feritperliare2890
      @feritperliare2890 3 роки тому

      @@sreea2365 it would be a lot harder than need be honestly

    • @feritperliare2890
      @feritperliare2890 3 роки тому

      @@sreea2365 well doing so might make it just cumbersome and inefficient so really just the comments is the best but it's still almost cheating