Taywee · @taywee
3 followers · 64 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Parsing SNAFU was pretty simple, but building it was harder. It's been a long time since I worked in number bases, and the negative digits really threw me for a loop. I ended up needing to get some help to figure out the proper way of building my SNAFU numbers, and I think it'll probably still be broken for negatives.

First AoC completion! :partyparrot:

#day25 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
3 followers · 61 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Done just in time. I went with a pretty straightforward A*, but because the accessible tiles change with time, I had each node be the tile's position as well as the entire field state at that point in time. The pathfinding crate is very powerful: docs.rs/pathfinding/latest/pat

Still took about 10 seconds. I could probably optimize it a lot, but it's done.

Part 2 was just doing it 3 times.

#day24 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
4 followers · 59 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Not a hard one. Part 2 takes over a full second to run, which could be improved a lot, but this was way nicer than day 22.

#day23 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
4 followers · 58 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Part 1 was super easy.

Part 2 was so hard I gave up and hardcoded the cube shape. 14 match cases, and it works on multiple input sizes but not on different shapes. I wanted to actually walk and find the next position, or to fold the cube and link them in a mesh of Rc<RefCell<_>>, but I already put too many hours into this and the idea of keeping track of orientation sounded like a pain.

#day22 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Ritchey · @ritchey
0 followers · 18 posts · Server det.social

Solved day 22 with the help of day12, my companion cube for today.

#AoC2022

Last updated 2 years ago

Taywee · @taywee
3 followers · 56 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Part 1 was straightforward: just build a tree and execute it.

I had a solution in mind for part 2 of solving the side of the root tree that I knew, then recursively running down the other side until I get to humn with a solution, but I decided to cheat and just used an equation solver library instead.

#day21 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Damiano Verzulli · @verzulli
24 followers · 69 posts · Server fosstodon.org

I'm struggling _A_LOT_, testing my DAY_12 implementation to solve P1. I can easily solve the "test"... but not the real input. I implemented two distinct versions of Dijkstra.... both with same result. Wrong result, when submitted :-(

Could someone share its P1 "input" and related solution, so, for me, to check my implementation?

#AdventOfCode2022 #AoC2022

Last updated 2 years ago

Damiano Verzulli · @verzulli
30 followers · 73 posts · Server fosstodon.org

I'm struggling _A_LOT_, testing my DAY_12 implementation to solve P1. I can easily solve the "test"... but not the real input. I implemented two distinct versions of Dijkstra.... both with same result. Wrong result, when submitted :-(

Could someone share its P1 "input" and related solution, so, for me, to check my implementation?

#AdventOfCode2022 #AoC2022

Last updated 2 years ago

Taywee · @taywee
3 followers · 56 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

This one was shockingly easy, even part 2. The toughest part was trying to figure out a way to keep track of what order to move the numbers in, particularly when there are duplicates. I gave up and just attached the original index to them and scanned each time. Far from perfect, but it got the job done without too much trouble.

#day20 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
3 followers · 56 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Really similar to the elephants and valves one. Just a DFS for the maximum with some optimizations to reduce the search space. Interestingly enough, it runs in 0.33 seconds on my actual input, but takes 15 seconds on the example, which is different from a lot of problems that take way longer on the real input. I think it's because the smaller costs on the example balloon the search space.

#day19 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
3 followers · 52 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Quick and easy one. For part one, just ran from the min to max for all axes in turn, incrementing each time a pair had one droplet and one air voxel. Part 2 was the same, but also with a pathfinding check between the air voxel and a known outside voxel.

Got sick of implementing my own coordinate types and just pulled in nalgebra.

#day18 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

0xBB :emacs: :biflag: :lisp: · @bond
147 followers · 203 posts · Server fosstodon.org

Time to finally start . I slept for two days straight and feel ready to participate in life again.

#AoC2022

Last updated 2 years ago

Taywee · @taywee
3 followers · 51 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Another very difficult one. Once it occurred to me that there would be probable cycles in the tower, I came upon a solution. It's not the nicest, but it's not too bad either. Some pessimistic input could probably still get the wrong answer, too.

#day17 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
3 followers · 51 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Oh my god. This problem was challenging and my code is hideous and full of redundancies. I'm not cleaning it up. I'm lucky I finished it at all.

I built my graph by calculating the shortest path between all non-zero valves and then discarding zeros. Then I just traversed with an inexact heuristic.

Part 2 was harder, having to track two routes at the same time. It was an absolute headache.

#day16 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Damiano Verzulli · @verzulli
24 followers · 68 posts · Server fosstodon.org

@omenos : I'm very proud of my DAY_10/P2 implementation, that actually are simply 15 line of *ADDITIONAL* code to P1:

gitlab.com/verzulli/advent-of-

Actually: such a "framebuffer" (~sort of...) problem, was really interesting!

Nevertheless, I'm really struggling filling the gap due to my late start (I started only on Dec 10th!) so... I have a 10 days "gap" to be dealt with! :-(

#perl #AdventOfCode2022 #AoC2022

Last updated 2 years ago

Taywee · @taywee
3 followers · 51 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

I am really happy with my part 1 solution, with a range-consolidation container that automatically combines overlapping ranges, and calculates the solution incredibly quickly.

I brute-forced doing part 2 by rows, which works quickly enough, but I kind of wish I had done it the right way, by checking around the intersections between the ranges of sensors. Don't want to put any more time into it.

#day15 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
3 followers · 51 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

This one was so much fun. I love falling sand simulations. Ended up losing a bunch of time on part 2 because I used a bounds check of my field as a condition, then regularly expanded my field, so I just kept exploding the size of my simulation.

I wish a did a visualization on this one.

#day14 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
2 followers · 38 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

Another one of way more time spent parsing than solving, but I'm satisfied that I could flex `impl Ord`, `Cow`, and my growing comfort in nom to make this one a lot cleaner and easier to read.

#day13 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

Taywee · @taywee
2 followers · 38 posts · Server fosstodon.org

of done in : gitlab.com/Taywee/adventofcode

I love pathfinding. Partially because A* is almost always appropriate, and partially because they lead to the most interesting visualizations.

#day12 #AdventOfCode2022 #rust #aoc #AoC2022 #adventofcode

Last updated 2 years ago

I just completed "Rope Bridge" - Day 9 - Advent of Code 2022 adventofcode.com/2022/day/9

#adventofcode #rust #AoC2022 #rustlang

Last updated 2 years ago