Coding a Bouncing Ball in Terminal

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 93

  • @karolisr
    @karolisr 2 ปีที่แล้ว +11

    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. 3 ปีที่แล้ว +190

    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 3 ปีที่แล้ว +32

      You must love Haskell.

    • @lufra0mon
      @lufra0mon 3 ปีที่แล้ว +3

      @@Bobbias Indeed I do. But I also love C.

    • @pineappleus3031
      @pineappleus3031 3 ปีที่แล้ว +4

      @@Bobbias But, fuck haskell

    • @jlacr8056
      @jlacr8056 3 ปีที่แล้ว +2

      that is actually very clever haha

    • @sylvainrocca-serra3402
      @sylvainrocca-serra3402 3 ปีที่แล้ว +9

      always go for maximum cuteness in code, most valuable metrics ^^

  • @vinicus508
    @vinicus508 3 ปีที่แล้ว +89

    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 3 ปีที่แล้ว +1

      Same

    • @nolanpestano1798
      @nolanpestano1798 3 ปีที่แล้ว +7

      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 3 ปีที่แล้ว +4

      @@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

  • @arcaneire
    @arcaneire 3 ปีที่แล้ว +58

    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 3 ปีที่แล้ว +1

      ikr, I only noticed its that long half way

  • @ziggy6698
    @ziggy6698 3 ปีที่แล้ว +22

    Best programming content on YT, dude. Love your stuff.

  • @CallousCoder
    @CallousCoder 3 ปีที่แล้ว +30

    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.

  • @VmanMaslov1995
    @VmanMaslov1995 3 ปีที่แล้ว +7

    Your videos are so extremely entertaining. Thank you, this is what I can really call recreational programming!

  • @ludomine7746
    @ludomine7746 3 ปีที่แล้ว +7

    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!

  • @MrHatoi
    @MrHatoi 2 ปีที่แล้ว +1

    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

  • @----__---
    @----__--- 2 ปีที่แล้ว +1

    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.

  • @_kk_
    @_kk_ 3 ปีที่แล้ว +36

    1:25:21 "let's keep 30 [fps] to make it CONSOLE friendly" AHAHHAHA aRolf

  • @randalltockes2247
    @randalltockes2247 10 หลายเดือนก่อน

    I love how you're just talking through high level thinking on the spot.

  • @vadiks20032
    @vadiks20032 3 ปีที่แล้ว +1

    видос как АСМР "звуки обьяснения програмиста под стук клавиш"

  • @elgrefa
    @elgrefa 3 ปีที่แล้ว +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

  • @LogicEu
    @LogicEu 3 ปีที่แล้ว +10

    Pretty cool, programming in C is pretty cool

  • @luismollmann1572
    @luismollmann1572 ปีที่แล้ว

    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!

  • @ryansanta
    @ryansanta 10 หลายเดือนก่อน

    @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.

  • @sujalbajracharya6401
    @sujalbajracharya6401 3 ปีที่แล้ว +2

    stuff like this makes me reconsider my decision to learn python or javascript

  • @starup4960
    @starup4960 3 ปีที่แล้ว +4

    Instead of bothering with compressing the rows, could you not just expand the columns by printing every character twice?

  • @papaoese6258
    @papaoese6258 3 ปีที่แล้ว +7

    This is damn amazing problem solving

  • @Георгий-г6б7г
    @Георгий-г6б7г 3 ปีที่แล้ว +6

    ^ It's not circumflex, it's caret. The difference: caret is character, circumflex is part of character such as ê

    • @TsodingDaily
      @TsodingDaily  3 ปีที่แล้ว +13

      No! I like calling it "circumflex" and nothing can stop me doing that from now on!

    • @Bobbias
      @Bobbias 3 ปีที่แล้ว

      @@TsodingDaily but he's technically correct, the best kind of correct...

    • @rogo7330
      @rogo7330 3 ปีที่แล้ว

      @@TsodingDaily circumF|£X×x :D

  • @JeremyNasmith
    @JeremyNasmith 3 ปีที่แล้ว

    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 3 ปีที่แล้ว +1

      If the compiler can tell that a value doesn't change inside a loop it usually pulls it out.

  • @salsa221
    @salsa221 3 ปีที่แล้ว +1

    The one programming channel I don’t fall asleep watching. The occasional curse word wakes me up

  • @nothingiseverperfect
    @nothingiseverperfect 3 ปีที่แล้ว +14

    Idk if I’m staying for the code…or for the personality LOL

  • @williamragstad
    @williamragstad 3 ปีที่แล้ว +5

    30 FPS??? First person shooter in the terminal next?

  • @aeideevie6237
    @aeideevie6237 3 ปีที่แล้ว +5

    Man your channel is a gem 💎

  • @pineappleus3031
    @pineappleus3031 3 ปีที่แล้ว +3

    One day, he will become the legend..

  • @marcususa
    @marcususa 3 ปีที่แล้ว +1

    49:28 "But this is actually kind of lame." LOL

  • @reezz1203
    @reezz1203 3 ปีที่แล้ว +1

    These kind of videos are very instructive ! Thanks !

  • @lars2299
    @lars2299 3 ปีที่แล้ว +2

    LMAO “like an American handball thing”

  • @fredesch3158
    @fredesch3158 9 หลายเดือนก่อน

    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

  • @delaight3536
    @delaight3536 3 ปีที่แล้ว +2

    deam i love your content! ty for teaching us

  • @nefree
    @nefree 3 ปีที่แล้ว +2

    What program do you use to enlarge the area? 28:00

  • @antoniwalburg47
    @antoniwalburg47 3 ปีที่แล้ว +1

    "I can render at 30 fps on the console ? what the fuck" some of Tsoding clips gonna make you think

  • @gabriellworks
    @gabriellworks 3 ปีที่แล้ว

    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 :)

  • @not_herobrine3752
    @not_herobrine3752 3 ปีที่แล้ว +4

    ive learnt a bit of c from tutorials and stuff, but how do i get to the advanced level?

    • @Bobbias
      @Bobbias 3 ปีที่แล้ว +4

      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 3 ปีที่แล้ว +1

      @@Bobbias thats a start, thanks for the advice!

    • @Bobbias
      @Bobbias 3 ปีที่แล้ว +3

      @@not_herobrine3752 oh, and in terms of programming techniques, learning about algorithms and data structures, algorithmic complexity, and such can be helpful.

    • @dennisfarmer1322
      @dennisfarmer1322 3 ปีที่แล้ว

      Yeah, literally just make stuff lol

  • @autonaut279
    @autonaut279 2 ปีที่แล้ว

    there definitely bodies in the basement.

  • @തകരച്ചെണ്ട
    @തകരച്ചെണ്ട 3 ปีที่แล้ว +10

    Your voice is therapeutic. :)

  • @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

  • @skeleton_craftGaming
    @skeleton_craftGaming ปีที่แล้ว

    American handball is totally what football should've been called but it already a thing...

  • @Anubis10110
    @Anubis10110 3 ปีที่แล้ว +2

    Superb programmer

  • @abdullahmertozdemir9437
    @abdullahmertozdemir9437 2 ปีที่แล้ว +2

    6:48 porn folder 8.8 gb in the bottom left?

  • @omarojmb
    @omarojmb 3 ปีที่แล้ว +2

    59:36 yeah! wtf! hahaha

  • @rogo7330
    @rogo7330 3 ปีที่แล้ว

    I wanna this ball in my kernel as hello world

  • @luberius
    @luberius 2 ปีที่แล้ว

    hahah dang, one of the best coding video in yt

  • @skeleton_craftGaming
    @skeleton_craftGaming ปีที่แล้ว

    Ascii has art glyph in it!

  • @Muhammed.Abd.
    @Muhammed.Abd. ปีที่แล้ว

    Dayumm, Nice 🔥

  • @nikolayvarlamov4065
    @nikolayvarlamov4065 3 ปีที่แล้ว

    Hey! Have you fixed the chromium bug? Have the same issue on i3wm with chromium

    • @TsodingDaily
      @TsodingDaily  3 ปีที่แล้ว +1

      No, it still occurs from time to time :(

    • @rogo7330
      @rogo7330 3 ปีที่แล้ว

      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

  • @weirddev
    @weirddev 2 ปีที่แล้ว

    You can play youtube too

  • @josephlagrange9531
    @josephlagrange9531 2 ปีที่แล้ว

    Hi, "how about that"!

  • @funmath3835
    @funmath3835 2 ปีที่แล้ว

    but bro what about haskell. are you leaving haskell?

  • @KangJangkrik
    @KangJangkrik 2 ปีที่แล้ว

    Next: rewrite whole code with vulkan

  • @jjanx4820
    @jjanx4820 3 ปีที่แล้ว +2

    Wth he so skinny now

  • @vladlen-fedorenko
    @vladlen-fedorenko 3 ปีที่แล้ว

    Your english is pretty cool

  • @TheUKofBananas
    @TheUKofBananas 3 ปีที่แล้ว +1

    Мужик , по тебе видно ,что ты русский ....))) И даже в описании ты палишься ,что из России )

  • @koishikisskogasa
    @koishikisskogasa 3 ปีที่แล้ว +2

    I want to be a nerd like you please :(

    • @TsodingDaily
      @TsodingDaily  3 ปีที่แล้ว +5

      You have my blessing. Now go be a nerd!

  • @Antyelektronika
    @Antyelektronika 3 ปีที่แล้ว

    Hi, have you maybe discord chanel?

  • @john.dough.
    @john.dough. 3 ปีที่แล้ว

    neat!

  • @kgarrison343
    @kgarrison343 2 ปีที่แล้ว

    Look out pixar

  • @leticiacristina3862
    @leticiacristina3862 3 ปีที่แล้ว

    :oops:

  • @tebibfathallahfathallah2008
    @tebibfathallahfathallah2008 3 ปีที่แล้ว

    i feel dump :'(

  • @griof
    @griof 3 ปีที่แล้ว

    Has tsoding channel died in favor of this one?

  • @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 3 ปีที่แล้ว +1

    1:24:34 :D

  • @Rogow-mo9yb
    @Rogow-mo9yb 3 ปีที่แล้ว

    красава

  • @old_cd_rom9518
    @old_cd_rom9518 3 ปีที่แล้ว +2

    Я не вижу русских

  • @andriii_
    @andriii_ 3 ปีที่แล้ว

    Мне кажется ты из России.