Got into the weeds a bit with today's Advent of Code (which I'm trying to solve using Rust, a language I don't yet know, combined with copious amounts of Copilot and ChatGPT to help me figure it out)

Sticking point was figuring out an idiomatic Rust way of reading a file three lines at a time - eventually got to something I didn't really dislike, but it was a messy process: https://github.com/simonw/advent-of-code-2022-in-rust/issues/4

Now reading https://fasterthanli.me/series/advent-of-code-2022/part-3 for a VERY different solution to the same problems

Day 3: Rucksack Reorganization · Issue #4 · simonw/advent-of-code-2022-in-rust

https://adventofcode.com/2022/day/3 The list of items for each rucksack is given as characters all on a single line. A given rucksack always has the same number of items in each of its two compartm...

GitHub
@simon I keep being surprised over and over at how different solutions are. It's amazing. I really struggled with day03 and collected links to a variety of solutions folks shared. In case it's useful: https://github.com/briandorsey/AdventOfCode/tree/main/2022/day03
AdventOfCode/2022/day03 at main · briandorsey/AdventOfCode

Advent of Code. Contribute to briandorsey/AdventOfCode development by creating an account on GitHub.

GitHub

@briandorsey @simon Wow there's a lot to study here! Also new to #rust and using #adventofcode as a means to learn it.

I eventually found iter.next_chunk() to pull 3 lines at a time, and which requires the nightly build, so I can feel like a real hacker 🤓

My solution here: https://github.com/blairfrandeen/2022-AoC/blob/master/src/day_3.rs

2022-AoC/day_3.rs at master · blairfrandeen/2022-AoC

Wherein I pretend I learned anythign at all about programming int he last year - 2022-AoC/day_3.rs at master · blairfrandeen/2022-AoC

GitHub