Coding a Bouncing Ball in Terminal

  Рет қаралды 81,087

Tsoding Daily

Tsoding Daily

2 жыл бұрын

References:
- Source Code: github.com/tsoding/la
- Playlist of the Previous Episodes: • Generating C Libraries
- Midpoint Visualization Algorithm in Rust Video: • Programming in Rust
- Website I stole the ANSI codes from: www.lihaoyi.com/post/Buildyou...
Support:
- Patreon: / tsoding
- Twitch Subscription: / tsoding
- Streamlabs Donations: streamlabs.com/tsoding/tip
Feel free to use this video to make highlights and upload them to KZfaq (also please put the link to this channel in the description)

Пікірлер: 95
@karolisr
@karolisr 2 жыл бұрын
The most beautiful/useful thing about the way these coding sessions are presented is the "thinking out loud" part. It is really helpful and interesting to see how he breaks down the problems into digestible pieces. This is probably the most important skill when writing code.
@john.dough.
@john.dough. 2 жыл бұрын
33:13 You missed the opportunity to use the (terrible) `-->` loop! as in `while (n --> 0)` the little arrow is cute, which is the most important factor in programming.
@Bobbias
@Bobbias 2 жыл бұрын
You must love Haskell.
@lufra0mon
@lufra0mon 2 жыл бұрын
@@Bobbias Indeed I do. But I also love C.
@pineappleus3031
@pineappleus3031 2 жыл бұрын
@@Bobbias But, fuck haskell
@jlacr8056
@jlacr8056 2 жыл бұрын
that is actually very clever haha
@sylvainrocca-serra3402
@sylvainrocca-serra3402 2 жыл бұрын
always go for maximum cuteness in code, most valuable metrics ^^
@ziggy6698
@ziggy6698 2 жыл бұрын
Best programming content on YT, dude. Love your stuff.
@vinicus508
@vinicus508 2 жыл бұрын
this is kinda beyond my current skills. But I watched it in the background simply because of how satisfying it is to see him coding and moving around the screen like mad WITHOUT using a mouse
@FLICITY
@FLICITY 2 жыл бұрын
Same
@nolanpestano1798
@nolanpestano1798 2 жыл бұрын
learn vim man, the amount of time you’ll be able to save is so substantial now once you get pass the initial learning curve
@vinicus508
@vinicus508 2 жыл бұрын
@@nolanpestano1798 yeah, it’s rly nice. I’m am a chemical engineering major tho. I dont have much free time to dedicate to that as of right now. But I will defo learn programming deeper whenever I have the chance to
@josueteodoro2342
@josueteodoro2342 2 жыл бұрын
@@nolanpestano1798 I mean, he's using emacs with i3 window manager. However, learning vim is a good way to start things off!
@arcaneire
@arcaneire 2 жыл бұрын
Wasn't expecting to watch an hour and a half of someone making a bouncing ball in console today but that's where we are. It was cool to see how you approached each part of the challenge and how you problem solved your way through it! I'm sure a lot went over my head but you did a good job explaining what you were doing.
@vinicus508
@vinicus508 2 жыл бұрын
ikr, I only noticed its that long half way
@VmanMaslov1995
@VmanMaslov1995 2 жыл бұрын
Your videos are so extremely entertaining. Thank you, this is what I can really call recreational programming!
@CallousCoder
@CallousCoder 2 жыл бұрын
The console is just a frame buffer on Linux. So you can go as fast as basically the bus and gpu blitter can go. Cool program, I really enjoyed the video.
@_kk_
@_kk_ 2 жыл бұрын
1:25:21 "let's keep 30 [fps] to make it CONSOLE friendly" AHAHHAHA aRolf
@----__---
@----__--- 2 жыл бұрын
this is probably one of the most entertaining videos in your channel. like i really enjoyed it lol. hope you can do more of small and simple stuff like this one.
@josueteodoro2342
@josueteodoro2342 2 жыл бұрын
I was looking for some tutorials on building console ui, and this helped so much, thank you!
@ludomine7746
@ludomine7746 2 жыл бұрын
my only criticism is that if were to see the ball after it goes off the screen, it would just stay on the ground while shifting right forever. you would need to add another dampener for the vel.x when it hits the ground. otherwise great vid!
@aeideevie6237
@aeideevie6237 2 жыл бұрын
Man your channel is a gem 💎
@delaight3536
@delaight3536 2 жыл бұрын
deam i love your content! ty for teaching us
@randalltockes2247
@randalltockes2247 6 ай бұрын
I love how you're just talking through high level thinking on the spot.
@papaoese6258
@papaoese6258 2 жыл бұрын
This is damn amazing problem solving
@MrHatoi
@MrHatoi 2 жыл бұрын
59:00 you can skip defining the feature test macros by setting -std=gnu11 instead of c11 when you compile, that defines pretty much all of the relevant ones for you
@reezz1203
@reezz1203 2 жыл бұрын
These kind of videos are very instructive ! Thanks !
@luismollmann1572
@luismollmann1572 10 ай бұрын
tsoding gives me zizek vibes of who wouldn't love to hear this, but he's lowkey a real role model to me. keep up the great humor, content and curiosity!
@LogicEu
@LogicEu 2 жыл бұрын
Pretty cool, programming in C is pretty cool
@salsa221
@salsa221 2 жыл бұрын
The one programming channel I don’t fall asleep watching. The occasional curse word wakes me up
@user-tm9hy5he8o
@user-tm9hy5he8o 2 жыл бұрын
Your voice is therapeutic. :)
@gabriellworks
@gabriellworks 2 жыл бұрын
pretty sure this will be in everyone's recommended after a while, so just wanna garantee that everyone knows I was here btw good coding for you, mate :)
@marcususa
@marcususa 2 жыл бұрын
49:28 "But this is actually kind of lame." LOL
@vadiks20032
@vadiks20032 2 жыл бұрын
видос как АСМР "звуки обьяснения програмиста под стук клавиш"
@lars2299
@lars2299 2 жыл бұрын
LMAO “like an American handball thing”
@elgrefa
@elgrefa 2 жыл бұрын
you could iterate from max(0,b.x) to min(WIDTH, e.x) and yau would run les times the comparison after that, minute 16:00
@nefree
@nefree 2 жыл бұрын
What program do you use to enlarge the area? 28:00
@fredesch3158
@fredesch3158 4 ай бұрын
22:08 "AN AMERICAN HANDBALL THINGY", I'm stealing this name, now that's the only way I'll call an american "football" from now on
@pineappleus3031
@pineappleus3031 2 жыл бұрын
One day, he will become the legend..
@sujalbajracharya6401
@sujalbajracharya6401 2 жыл бұрын
stuff like this makes me reconsider my decision to learn python or javascript
@luberius
@luberius 2 жыл бұрын
hahah dang, one of the best coding video in yt
@Muhammed.Abd.
@Muhammed.Abd. 10 ай бұрын
Dayumm, Nice 🔥
@williamragstad
@williamragstad 2 жыл бұрын
30 FPS??? First person shooter in the terminal next?
@omaramo190683
@omaramo190683 2 жыл бұрын
59:36 yeah! wtf! hahaha
@antoniwalburg47
@antoniwalburg47 2 жыл бұрын
"I can render at 30 fps on the console ? what the fuck" some of Tsoding clips gonna make you think
@Anubis10110
@Anubis10110 2 жыл бұрын
Superb programmer
@ryansanta
@ryansanta 6 ай бұрын
@Tscoding Daily If we were simply trying to make the circle look better, instead of comparing rows, couldn't you just print 2x chars (estimating the char height is ~2x the width)? I'm sure there's also a way to find the exact ratio and print 1or2 chars based on a max total row width. I think it would be interesting to approach the problem this way, though your row comparison solution is more elegant and already works.
@nothingiseverperfect
@nothingiseverperfect 2 жыл бұрын
Idk if I’m staying for the code…or for the personality LOL
@starup4960
@starup4960 2 жыл бұрын
Instead of bothering with compressing the rows, could you not just expand the columns by printing every character twice?
@autonaut279
@autonaut279 2 жыл бұрын
there definitely bodies in the basement.
@user-rp6sv9vy3x
@user-rp6sv9vy3x 2 жыл бұрын
^ It's not circumflex, it's caret. The difference: caret is character, circumflex is part of character such as ê
@TsodingDaily
@TsodingDaily 2 жыл бұрын
No! I like calling it "circumflex" and nothing can stop me doing that from now on!
@Bobbias
@Bobbias 2 жыл бұрын
@@TsodingDaily but he's technically correct, the best kind of correct...
@rogo7330
@rogo7330 2 жыл бұрын
@@TsodingDaily circumF|£X×x :D
@wliaputs
@wliaputs 2 жыл бұрын
My goodness how can you use both Emacs and Vim at once, you're a mad man Edit: oh wait I might have mistook the bash in tmux as vim lol
@rogo7330
@rogo7330 2 жыл бұрын
I wanna this ball in my kernel as hello world
@not_herobrine3752
@not_herobrine3752 2 жыл бұрын
ive learnt a bit of c from tutorials and stuff, but how do i get to the advanced level?
@Bobbias
@Bobbias 2 жыл бұрын
Well, you take what you've learned, and try to make stuff. Along the way you will run into things you're not sure how to do. When that happens, look up references, check Stack overflow, and generally try to find a solution. As you solve those sort of problems, you will learn a lot. I don't code in c, so I don't have any resources I could send you, but there are tons of them out there. If you haven't already, look for books about programming in c. There are probably a few free books online. The more resources you find, the better chance you have of finding something that really works well for you to learn from. But there is absolutely *no* substitute for just writing code.
@not_herobrine3752
@not_herobrine3752 2 жыл бұрын
@@Bobbias thats a start, thanks for the advice!
@Bobbias
@Bobbias 2 жыл бұрын
@@not_herobrine3752 oh, and in terms of programming techniques, learning about algorithms and data structures, algorithmic complexity, and such can be helpful.
@dennisfarmer1322
@dennisfarmer1322 2 жыл бұрын
Yeah, literally just make stuff lol
@john.dough.
@john.dough. 2 жыл бұрын
neat!
@josephlagrange9531
@josephlagrange9531 2 жыл бұрын
Hi, "how about that"!
@JeremyNasmith
@JeremyNasmith 2 жыл бұрын
In your circle function: set rSqr = r*r beforre both for loops. set yWidth = y*Width and ySqr = y*y inside y loop, before x loop. Use these values within x loop instead of calculating them x times per y iteration. Also, check that y is in range outside x loop, save a bunch of x loops.
@a-rod6336
@a-rod6336 2 жыл бұрын
If the compiler can tell that a value doesn't change inside a loop it usually pulls it out.
@skeleton_craftGaming
@skeleton_craftGaming Жыл бұрын
Ascii has art glyph in it!
@nikolayvarlamov4065
@nikolayvarlamov4065 2 жыл бұрын
Hey! Have you fixed the chromium bug? Have the same issue on i3wm with chromium
@TsodingDaily
@TsodingDaily 2 жыл бұрын
No, it still occurs from time to time :(
@rogo7330
@rogo7330 2 жыл бұрын
I never had this problem on i3wm, but i not sure because i remember that i had a lot of shit with it in past until i fixed all
@vladlen-fedorenko
@vladlen-fedorenko 2 жыл бұрын
Your english is pretty cool
@leticiacristina3862
@leticiacristina3862 2 жыл бұрын
:oops:
@skeleton_craftGaming
@skeleton_craftGaming Жыл бұрын
American handball is totally what football should've been called but it already a thing...
@jjanx4820
@jjanx4820 2 жыл бұрын
Wth he so skinny now
@KangJangkrik
@KangJangkrik 2 жыл бұрын
Next: rewrite whole code with vulkan
@TheUKofBananas
@TheUKofBananas 2 жыл бұрын
Мужик , по тебе видно ,что ты русский ....))) И даже в описании ты палишься ,что из России )
@abdullahmertozdemir9437
@abdullahmertozdemir9437 Жыл бұрын
6:48 porn folder 8.8 gb in the bottom left?
@atlantic_love
@atlantic_love Жыл бұрын
That's creepy, lol.
@weirddev
@weirddev 2 жыл бұрын
You can play youtube too
@kgarrison343
@kgarrison343 2 жыл бұрын
Look out pixar
@koishikisskogasa
@koishikisskogasa 2 жыл бұрын
I want to be a nerd like you please :(
@TsodingDaily
@TsodingDaily 2 жыл бұрын
You have my blessing. Now go be a nerd!
@Rogow-mo9yb
@Rogow-mo9yb 2 жыл бұрын
красава
@funmath3835
@funmath3835 2 жыл бұрын
but bro what about haskell. are you leaving haskell?
@Antyelektronika
@Antyelektronika 2 жыл бұрын
Hi, have you maybe discord chanel?
@tebibfathallahfathallah2008
@tebibfathallahfathallah2008 2 жыл бұрын
i feel dump :'(
@josh1234567892
@josh1234567892 2 жыл бұрын
22:09 I think you meant American football haha, to be fair football is a stupid name for the sport.
@adamselepin6657
@adamselepin6657 2 жыл бұрын
1:24:34 :D
@griof
@griof 2 жыл бұрын
Has tsoding channel died in favor of this one?
@old_cd_rom9518
@old_cd_rom9518 2 жыл бұрын
Я не вижу русских
@andriii_
@andriii_ 2 жыл бұрын
Мне кажется ты из России.
Searching Duplicate Files with C
2:39:23
Tsoding Daily
Рет қаралды 35 М.
Writing Garbage Collector in C
1:43:38
Tsoding Daily
Рет қаралды 59 М.
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 2,8 МЛН
Самое Романтичное Видео ❤️
00:16
Глеб Рандалайнен
Рет қаралды 6 МЛН
Me: Don't cross there's cars coming
00:16
LOL
Рет қаралды 15 МЛН
когда повзрослела // EVA mash
00:40
EVA mash
Рет қаралды 4,3 МЛН
Using C instead of Bash
1:14:06
Tsoding Daily
Рет қаралды 41 М.
Windows Development on Linux
2:15:17
Tsoding Daily
Рет қаралды 49 М.
Async Rust Is A Bad Language | Prime Reacts
28:46
ThePrimeTime
Рет қаралды 89 М.
Writing My Own Malloc in C
2:07:13
Tsoding Daily
Рет қаралды 200 М.
This Data Structure could be used for Autocomplete
1:54:31
Tsoding Daily
Рет қаралды 41 М.
CONCURRENCY IS NOT WHAT YOU THINK
16:59
Core Dumped
Рет қаралды 89 М.
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 381 М.
I Made a Drawing Software From Scratch (C++ & OpenGL)
11:05
IamWassim
Рет қаралды 9 М.
WHY IS THE HEAP SO SLOW?
17:53
Core Dumped
Рет қаралды 208 М.
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 32 МЛН
Игровой Комп с Авито за 4500р
1:00
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 2,1 МЛН
Samsung Galaxy Unpacked July 2024: Official Replay
1:8:53
Samsung
Рет қаралды 23 МЛН
Как слушать музыку с помощью чека?
0:36
Choose a phone for your mom
0:20
ChooseGift
Рет қаралды 6 МЛН