grid traversal with pattern matching - Day 16 - Advent of Code 2023

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

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

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

    I ended up using 'sed' to convert every backslash to a 'x' in my input file. I couldn't figure out how to stop Ruby from escaping my backslashes and I think it was because my filename was "input.txt". I just tried it without the extension (just 'input') and it worked fine just like yours!
    My part 2 ended up being nearly instant, but I think it's because I used recursion and only sets/hashes. If I didn't hit a stack overflow, I probably would have taken forever to figure out the infinite loop problem! Your methods for handling the turns and special characters was much more elegant than mine, I ended up using nested cases lol
    I always manage to learn a lot from watching you work through the problem, thanks for sharing!

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

      The backslash thing is confusing!!
      Would love to see your recursive solution if you’re down to share.