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.
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
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 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!
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
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
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!!
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 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.
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
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.
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.
@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"
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.
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!
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
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...
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
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.
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 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.
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.
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.
@@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
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.
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.
@@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.
@@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.
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.
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
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
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...
@@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.
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
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.👍🏻🇦🇷🇺🇸
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.
@@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
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
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
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.
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.
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."
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....
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?"*
@@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.
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.
Whats your method to try to learn something new every day?
love it man thanks for sharing, this is computer science meets poetry
Lawrence Gatley thanks I also have a video about it on my channel. ☺️
You're the man Lex
Very cool! Keep doing a good job, the chanel keeps improving 👍🏼
The minimalism of ASCII art is still fascinating and intriguing.
Ok
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
YES, play Dwarf Fortress
@@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?
It’s witchcraft. Heresy.
"Your theory of a Donut-shaped Universe is intriguing, Homer"
- Stephen Hawking
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.
There's actually a serious scientific theory about the universe being shaped like a hyper-torus, or a 4 dimensional donut
He stole it!
@@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!
@@halinalane1426 I'm thinking on another timeline somewhere there's a room with Stephen Hawking and 6000 timetravellers all squashed together....
Man talking about coding and using terminology
Me: hehe look at the donut go
Haha doughnut go whoosh
nooooo you can't just watch the video without paying attention!!!!!😤😤😤😤
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
@@fcantil haha attention span go brrrrrr
this could be a new meme, damn, everything can be a meme nowadays
This guy sounds like he's dead inside but also sounds like he really enjoys what he's doing.
My spirit animal
It's beautiful. I've looked at this for five hours now.
Hello Tom Haverford.
The code or the animated donut?
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
@@bbroadcast3919 bruh. its a quote from a tv show
Get a job lame
Every minute I spend on this channel leaves me with valuable knowledge and expanded curiosity. Thank you.
That’s the beauty about it. You always want to know more the more you get knowledge !
Cool! I just leave confused
Lmao you’re worrying about the wrong things in life if this “animation” is knowledgeable to you get a real job kids
Every minute I spend on this channel leaves me feeling like a complete dumb ass but I thoroughly enjoy ya Lex. Love ya brotha!
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
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!!
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.
I see you are part of the new generation who will never understand computers since they do everything automatically.
@@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.
It’s ASCII characters.
@@wearethewearethewearethhe Gate keeping is not cool, nor is it productive in any way. Do better.
"With syntax highlighting"
You mean with sprinkles
@@Prokesh beanut
That is the best thing I've read today :)
He may have outsmarted you, but you outsmarted his outsmarting
...
When you change that 999 to 1K.
Chuckles: This comment is useless.
The dude: Tells us exactly how they created this complex rotating torus
Me: ʰᵃʰᵃ ᵈᵒⁿᵘᵗ ˢᵖᵉᵉⁿ
How did you make those letters small like what
@@mastergamerwasd5508 They's called superscript letters. You can type your text and copy paste it on this site: smalltext.io/
@@Dtomper Ooohhh thx!
ʸᵉᵃʰ ᵍᵒ ˢᵖᵉᵉⁿ
*ʰᵃʰᵃ ʸᵉˢ*
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
that's basically any art and it is great indeed
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.
@@dizzylimmetell me more please
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.
@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"
I want someone to build a full 3d game using these techniques
I will soon
I'm planning to
You're on.
You guys kidding right?
@@bagastian3125 No. Join us.
What my friends code : *full adventure games, complete with a full map, weapons, bosses, and more*
What i code :
Dude don't kid yourself, if you're doing stuff like this that's still really impressive.
ya
You have friends who code games? And you code mathematical demonstrations?
I got you 50
I can only make models and stuff :/
I have no idea what the hell is going on, but it's cool to watch
Its making me hungry
It’s spinning both directions is what’s interesting
*This code take me back to the Commodore 64 days! Man, we knew how to party with sophisticated animations!* 😂
Terry a davis
Why do you always bold your comments
@@jpeg.600x2 temple os?
lol
I'll just pretend to understand what you said
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.
I love how society just collectively decided that any circulars shape with a hole in the middle is a donut
it's not a ring. Not a tire. Not a damn toilet paper roll. It's a donut. 💯
Or you can refer it as it's formal name which no one in the world would call: torus.
It is a torus, so calling it a donut wouldn’t be that misleading
@@whenwhen2284 yeah it's just 3 letters wrong out of 5, not that wrong
@@戴劭名-z8p really? I thought it gave off pisces vibes
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!
need a dispenser here
need a dispenser here
*Why model a donut in Blender when you can just program it.*
I can't do either.... I can only eat it 😭😭
I can only make an actual blender
in blender
@@BURN-ADDiCT i dont have money to eat it lmao
i can just look at it o_o
This is truly one of the donut ever
Somebody : you don't need math for programming
Him : hold my donut
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
Definitely. Although most of the time we don't use math in programming but having good mathematical skills will help you program better.
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...
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
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.
"In 2020 we will have flying cars"
2020: ASCII donut go spinny spin
Brrrrrr
it would be weird that if we would have flying cars now but not spinnin donuts
We have both now.
Maybe in 3020 flying cars could be reality
The internet is way cooler than flying cars imo
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.
He made it in 20 seconds??
Edit: didn't notice it was a dream lol
@@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.
@@fear7356 it's a dream
No shot
@@Shaze1 i used to read word-up magazine
I have zero idea about anything you explained here but the donut is hypnotic.
My friends all went out to a party without me and I’m watching this.
Better
Currently at a party and watching this :)
I love the "because I can" attitude of that programmer. ♥️♥️
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.
@@jacksonsmith2955 thanks! Into the rabbit hole I go 😂
Part II: Dipping the donut in a cup of coffee
🍩 -> ☕️
@@aBraveNewNormal Klein bottle*
You mean doing that in coffee-script.. ?
The code is shaped like C dripping into Java
Part 3: a vampire donut machine.
part 3: stardust crusaders XD
10 years worth of program in movies: *Makes a crazy codes that hacks the entire country*
10 years worth of program irl: *DONUT*
"On the left is a spinning donut"
Yes, we can tell that it is spinning sir
"On the left is a donut"
It's actually a spinning donut sir
Its for blind people
Change my mind
@@Casteray *changing ur mind*
I want spinning banana
I thought it was a jumping gummy bear
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.
My favorite part of programming is putting in some simple instructions and getting something complex back.
"It's amazing to think what great and exciting things people will be doing with PC's in 30 years."
- Bill Gates, 1989
*Donut-shaped C code that generates a 3D spinning donut*
Quoting Bill Gates didn’t age well.
@@c0nc3ntr8d6 his divorce has nothing to do with this though
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.
@@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
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.
I got you 10
I love how you say “hope this is a value, fun and something you enjoy.” With no enthusiasm whatsoever bahaha
lol true
Once you watch enough Lex, you'll slowly come to realize that that intonation is the sound of him having a great time
He takes having fun very seriously!
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.
@@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.
Somebody needs to set the spinning donut to an 8-bit rendition of around the world.
your comment is my command ua-cam.com/video/XQn28L1ZhKg/v-deo.html
Normal people: While(true){...}
Woke man Lex Fridman: for(;;){...}
@@DanielNyong it was a joke
@@DanielNyong woosh
200% bespoke: x: {...} goto x;
true intellectuals: for (;; …);
@@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.
"It's all donut?"
"Always has been."
Hahahahaha haha
🔫
Mat Roz'
**eats gun**
@@goodnight63 Ronaldinho Saucer
funny reddit meme. take my upvote kind chungus
My coding resume: "I have the code to create a moving donut!"
a spinning ascii donut
Bruh i was soo confused it said 27 years ago 😤😤😱😱
You’re hired
@@borisgalanovthekgbagent6393 im happy he is hired for iStock
U got me with the 27 years ago lmao
He sounds so happy
Him: how he created the complicated code to make such a 3d donut shape
Me: _you're making me hungry_
its not that complicated, its just compact, its really just 5th grade math with a text readout
@@Noel_FGC You do relize this comment was intendet to be funny. So ıt doesnt realy matter
@@Noel_FGC there's always that guy
@@glarms6355 you do realize my reply wasn't intended to be serious right? so it doesn't really matter
@@Noel_FGC Well I didnt get the joke apertnly
So this is why aliens don't visit us...
*We're way to powerful*
they had us in the first half not gonna lie
Everyone expects aliens to be strong, they may be more advanced OR the opposite.
too*
I made this 100 likes
@@spaceclips1404 next up on supergenius:
Shading and everything, this is astounding
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.
teri pehn nu 🇮🇳
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
Ecole 42?
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
@@fillerbunnyninjashark271 This was painfully motivational.
This program is more math than program.
@@teh_jibbler yes..... but I suck at both though
None of the comments I've read seem to comprehend how complicated and amazing this feat is.
Because we have soy running thru our brains.
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...
@@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.
It's not exactly complicated, what makes this so cool is the golfing aspect.
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;}}/*****####*******!!=;:~
~::==!!!**********!!!==::-
.,~~;;;========;;;:~-.
..,--------,*/
I feel like I was only recommended this because of all the JJBA vids I watch
Haha dio go muda
Diavolo go-
I was looking for that comment
Kakyoin....
nandato?! samee
It is unbelievably awesome. The understanding you have about math and as well as coding can't be said. Respect!!!
People who do coding stuff: hmm, interesting
Everyone else: hee hoo donut go wee haha
i understand it
oops forgot to add "0%"
Everyone like the spinning donut
Me as a coder had a reaction as everyone else.
@@paulpavlinskyi4793 Same haha
Donuts and coffee with Lex
how I'm spending my afternoon
It work! Just had to add the libs:
#include
#include
#include
#include
This guy explaining computer science while 99% of us is just here like
HHEEHOO SP I N DO N UT
Please share more stuff like this Lex! My mind is lighting up trying to figure out how all of this works.
You might wanna check out a talk titled ‘The Art Code’ on youtube by Dylan Beattie.
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
I’ve seen this video before and UA-cam continues to recommend it to me everyday
This is the nerdiest flex I've seen in a while and is very impressive!
@@الإسلامدينالحق-خ5ت first find out why are YOU here ?
This is the deep intellectual content I subscribe to you for
This was fun, more of these bite size content.
Anon yasss
Can’t believe you made Rengoku in 3D
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.👍🏻🇦🇷🇺🇸
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.
I like how someone will do this just because they can. Beautiful.
Incredible. This is exactly what I'm looking forward to learning.
How to explore my mind and imagination using programming
Him: freaking Albert Einstein
Me: hehe donut go brrrrrrrrr
Not that it matters but I feel it should be said, I'm the 69th like.
@@lenidev i can't like now ;(
Even Einstein couldn't make a spinning donut with symbols.
@@lenidev nice
@@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
And me in blender🌚💔
@boy lasagna hmm.. years* my laptop ain't that strong damn..
Default cube squad here
Donut lord
@boy lasagna my first project is a car, big mistake
@@ajemajh Mine was a plane like 3 years ago lol
Idk why but for some reason i had the Freebird riff playing in my head when i saw the donut spin
i hope this will forever be lex’s most viewed video
Blender guru: hold my coffee cup
Your videos have a way of reminding me that I need to get my shit together
elck3 Get your shit together.
al form in his minimal form is a sphere or a derivate of a perfect donut
Me at the beginning of video: oh that looks interesting
Me at the end: Doughnut. *ROTAT E*
Lex: explaining insane, complicated coding based on complex mathematics
Me: hehe donut go brrrrrrr
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
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
this dude: spinning computer donut
1.1 million people: *yes*
@Y K dude it’s a spinning donut not a Reddit post
ive been recomended this video almost every other day for 2 years now.. FINE ILL WATCH IT LEX!!!
Me: ooo spinning donut
*starts showing the math and steps*
Me: aight imma head out
everyones gangsta until maths came in
Best joke so far
This takes Portgas D. Ace fanart to a whole new level
Ace fans 🤝 Rengoku fans
Donut
Me: has to study for finals
UA-cam recommendations: donut go spin spin
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.
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.
its just a friking ascii donut
Nothing about this involves any recent tech or knowledge at all.
This pretty much demonstrates reality
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."
I have no clue what is happening but im living for it
that's why I want to degree in computer science, to draw a freaking spinning donut
😂
love the inventiveness and simplicity of this!
"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."
Next step is to make a program that takes a program and wraps it into a 3d donut and compiles it.
Next video: Spinning donut that generates C code
Him : " *I used the donut to make the donut.* "
I entered this video wanting to see an spinning donut and i exited it feeling bad with myself
Finally watched this video. Algorithm ain't leaving me alone
Have no idea what I'm looking at
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....
Hello, could you help me, I don't know how to do it: 'v
Hi Andy. Maybe. But you didn't do what exactly?
add code "system ("CLS");" inside int() main{}
Dennis Ritchie: "You won't believe what people will be able to do with C language in the future!"
Future:
Unbelievable, right?
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?"*
I like how the code is the donut itself
This is great. I love all the stuff from the Obfuscated C Code Contest.
Awesome doughnut tutorial
Here the comment you're not searching for:
Kakyoin
abbachio
@@creepyposting
I may have outsmarted you but you Outsmarted my Outsmarting
...
And now i feel sad
bruno bucciarati
0:41
@@matadordeinhumanos2749 what why did you do dat
"There is the donut and the hole, you gotta keep you eye on the donut and not the hole" - David Lynch
Reminds me of my early years of programming when I programmed a walking man and a rotating pyramid, among many others!
No one:
UA-cam: Wanna see a spinning code donut?
Me: Hell yeah
nobody:
quarantine: Donut-shaped C code that generates a 3D spinning donut
To be fair he's cheating on the last part of the code with the comment part
@@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.
@@sreea2365 it would be a lot harder than need be honestly
@@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