Advent of Code 2023 Day 2: Cube Conundrum

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 17

  • @nickwarters
    @nickwarters Год назад +10

    You just blew my mind with the else block on the for loop! Had no idea this was a thing!

    • @SirCorrino
      @SirCorrino Год назад

      That is some of the most cursed python I've ever seen. It works because under the hood a for loop is essentially an if with a goto to the start of the loop and you can then just add an else onto that, but it just feels wrong.

  • @JasonBrackman
    @JasonBrackman Год назад +11

    Your explanation took less time than I took to finish. :).
    - The enumerate has this this interesting quality where you can start at any number you want. enumerate(iter, 1) would start at 1 to avoid the offset.

    • @hyper-neutrino
      @hyper-neutrino  Год назад +1

      Oh, wait what? That's really cool, TIL. Thanks for the great tip!

  • @marcossantos1998
    @marcossantos1998 Год назад

    Hey thanks for solving those with commentary! Helps a ton someone whos starting out

  • @Mraeth8n
    @Mraeth8n Год назад

    What color theme and font are you using? It looks really cool!

    • @hyper-neutrino
      @hyper-neutrino  Год назад +1

      The color theme is GitHub Dark, the font is Monaspace Radon, and as an added bonus, the icon theme is material-icon-theme

    • @Mraeth8n
      @Mraeth8n Год назад

      @@hyper-neutrino Thank you !

  • @felix.delrubio
    @felix.delrubio Год назад +1

    It was a good hunt. You can "else" a "for" loop? Nice trick...

    • @hyper-neutrino
      @hyper-neutrino  Год назад +2

      Yeah, you can do it on a while loop too (same idea)

  • @disputer89
    @disputer89 Год назад

    Thanks for the video! Could you tell me the name of the font you are using in code?

    • @hyper-neutrino
      @hyper-neutrino  Год назад +1

      I'm using Monaspace Radon from GitHub Next. It's a bit unusual but I really like it; let me know what you think about it!

    • @disputer89
      @disputer89 Год назад

      @@hyper-neutrino Thank you for your answer. I set up code to use Monaspace Radon for some languages and document types (py, md, adoc) for which I prefer the handwritten style now that I have discovered this font. So far I really like it. I still use Dank Mono for anything else because of the nice italics.

  • @JoelKaneshiro
    @JoelKaneshiro Год назад

    I agree that Day 2 was easier than Day 1, at least for me.

  • @mrlectus
    @mrlectus Год назад

    My solution was monstrous, Am ashamed of it, but it works😅

  • @mohammedsouleymane
    @mohammedsouleymane Год назад +1

    I combined all the sets cause they were irrelevant. Don't really see the use of the sets maybe I'm wrong.

    • @hyper-neutrino
      @hyper-neutrino  Год назад +1

      Yeah, the grouping is actually not needed and you can just replace ; with , and then process it all at once. I only noticed this afterwards; perhaps I will revisit it someday.