#AdventOfCode 2024 day 1, in #RustLang in some 30-ish lines of code.

AOC always starts off gentle, and this is no exception. Can be coded in a couple minutes.

This is the first year where I’m using my new AOC workbench, which gives me the opportunity to share data structure/algorithms between years/days, and compiles everything in a single binary.

https://github.com/teotwaki/aoc/blob/main/2024/01/src/lib.rs

aoc/2024/01/src/lib.rs at main · teotwaki/aoc

Contribute to teotwaki/aoc development by creating an account on GitHub.

GitHub

#AdventOfCode 2024 day 2, in #RustLang in about 50-ish lines of code.

Step 1 was easy, step 2 was easy to understand, but a bit harder to express elegantly. Not sure I succeeded :).

https://github.com/teotwaki/aoc/blob/main/2024/02/src/lib.rs

#AOC2024

aoc/2024/02/src/lib.rs at main · teotwaki/aoc

Contribute to teotwaki/aoc development by creating an account on GitHub.

GitHub

#AdventOfCode 2024 day 3, in #RustLang in about 35-ish lines of code.

This one was fun. I always like @ericwastl's parsing challenges.

https://github.com/teotwaki/aoc/blob/main/2024/03/src/lib.rs

#AOC2024

aoc/2024/03/src/lib.rs at main · teotwaki/aoc

Contribute to teotwaki/aoc development by creating an account on GitHub.

GitHub

#AdventOfCode 2024 day 4, in #RustLang.

We're back to the coordinate system and a good old grid. I implemented a generic grid that I'm hoping to re-use in past challenges as well. I also massively extended the generic Coordinates struct. I'd say step2 was significantly easier than step1.

https://github.com/teotwaki/aoc/blob/main/2024/04/src/lib.rs

#AOC2024

aoc/2024/04/src/lib.rs at main · teotwaki/aoc

Contribute to teotwaki/aoc development by creating an account on GitHub.

GitHub

#AdventOfCode 2024 day 5, in #RustLang.

I really enjoyed this one. Again Rust's windows API proves incredibly practical. I thought reordering would be more tricky, but it ended up working on the first try.

https://github.com/teotwaki/aoc/blob/main/2024/05/src/lib.rs

#AOC2024

aoc/2024/05/src/lib.rs at main · teotwaki/aoc

Contribute to teotwaki/aoc development by creating an account on GitHub.

GitHub

#AdventOfCode 2024 day 6, in #RustLang.

This is the first challenge this year that makes me break into the seconds-scale. 1.882s to get step2. I did some optimistic shedding of blocker locations, but it only reduces the number of required simulations by 200 (~4%). Still an improvement of ~100ms.

https://github.com/teotwaki/aoc/blob/main/2024/06/src/lib.rs

#AOC2024

aoc/2024/06/src/lib.rs at main · teotwaki/aoc

Contribute to teotwaki/aoc development by creating an account on GitHub.

GitHub

#AdventOfCode 2024 day 7, in #RustLang (~60 lines)

This was a surprisingly easy day. As soon as I read the challenge I understood how to solve it. I wouldn't be surprised if there's a faster method, but the obvious one works.

https://github.com/teotwaki/aoc/blob/main/2024/07/src/lib.rs

#AOC2024

aoc/2024/07/src/lib.rs at main · teotwaki/aoc

Contribute to teotwaki/aoc development by creating an account on GitHub.

GitHub

@teotwaki yep, nice one today, and little bit confusing, I just say X-MAS! 😆

#AOC2024 #Tokay #tokaylang

@teotwaki I also made a grid type last year and it's pretty helpful today
https://github.com/LesleyLai/AOC2024/blob/main/day4/src/main.rs
AOC2024/day4/src/main.rs at main · LesleyLai/AOC2024

Contribute to LesleyLai/AOC2024 development by creating an account on GitHub.

GitHub