day 08 - advent of code 2024 in rust

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

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

  • @misterwoody_
    @misterwoody_ Месяц назад +3

    I mentally substituted "antenna" for "satellite" based on the problem on Advent of Code (hope I understood it correctly) - that was the easy part. Thanks for the daily uploads. Certainly learning a lot about nom.

    • @bas-ie
      @bas-ie 22 дня назад

      haha I had the same experience!

  • @flwi
    @flwi Месяц назад +1

    Nice one! Thanks for sharing! I found a more typesafe way to create the combinations.
    ```
    let antinode_locations = locations
    .iter()
    .tuple_combinations()
    .flat_map(|(a, b)| {
    ...
    }
    ```
    With that combinator from itertools you don't need to access the vec by indices. (9:54).
    Anyway - I'm quite impressed by how fast rusts iterators are while keeping the code readable.

    • @chrisbiscardi
      @chrisbiscardi  Месяц назад +1

      @@flwi ah tuple combinations would've been mint. Nice find.

    • @flwi
      @flwi Месяц назад

      @@chrisbiscardi TIL ;-)
      "Mint" as slang for "excellent" or "perfect" is more commonly used in British and Australian English, often in phrases like "that's mint" or "it was mint." While some Americans might use it due to global cultural exchange, it's not a typical American slang term. In American English, similar expressions might be "that would have been awesome" or "that would have been perfect."
      If you saw this in context, you might be able to tell if it was written by someone from a region where "mint" is common slang, or if it was indeed a typo for another word.

  • @catsolstice
    @catsolstice 29 дней назад

    31:30 you should be able to just chain the two iterators without boxing anything (may need some adjustments)

  • @bas-ie
    @bas-ie 22 дня назад

    TIL successors! Thanks :)