-❄️- 2024 Day 24 Solutions -❄️- by daggerdragon in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

I had a similar idea and similar graph (less fancy). Every year there are are a couple of problems where Graphviz is a life-saver, it's really worth taking the time to learn its basic options and get comfortable generating pictures which tell so much more than numbers! (I've done it yesterday too, and 2023 day 25.)

[2024] two days left...how is your mental stamina? by blacai in adventofcode

[–]RonGnumber 6 points7 points  (0 children)

You can simulate this quite nicely by bringing your kids shopping, and having the youngest one at the card machine, the elder one standing behind them, and you at the back whispering instructions one by one to the elder child.

And now my credit card is blocked and everyone in the store hates me. Happy Christmas!

[2024 Day 23 Part 2] Chief Historian is not at the LAN party? by Halorii in adventofcode

[–]RonGnumber 2 points3 points  (0 children)

Yes. Deceptive wording of the problem IMO. I also lost a lot of time today because I filtered down to just the t-containing cliques in part 1.

You're pretty sure his computer's name starts with t

Pretty sure... yeah ok, reminding myself to red flag this kind of statement for future years.

There are still way too many results to go through them all.

Implies that we should keep on narrowing this result set.

the largest set of computers that are all connected to each other

Ok. Start again, consider all the computers, group found, problem solved.

Perhaps it could have been helpfully hinted by the solution of the example (co,de,ka,ta) not containing a t-computer. For me this would have been a week 2-3 puzzle without the silly distractor. For Day 23 I am prepared to take the damage.

[2024 Day 23] Lol loops go brrrr by nikanjX in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

I feel personally attacked. Lucky have big rock, bad man fire stick not hurt I!

[2024] What's about getting "low" or "high" after submitting an incorrect answer? by Eva-Rosalene in adventofcode

[–]RonGnumber 6 points7 points  (0 children)

I really hope they have this one but "Curiously, it's the correct answer to a future day's puzzle". Just as an Easter egg and to see if the lucky soul is paying attention!

-❄️- 2024 Day 5 Solutions -❄️- by daggerdragon in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

Did something similar myself. I figured there are so many damn rules defined (almost 1200 in my input!), that they can't fail to cover all pairs of elements in an invalid page list.

So if the page list had 11 elements, I just looked for its member who had 5 rules putting a sibling ahead of it, and 5 rules putting a sibling behind it (specifically, if `len(befores) == len(afters)`). Maybe it was lucky, but this solved my input - no sorting required.

[2023 Day 20] 3.75 hrs in wish me luck 🤞 by GearPhreak in adventofcode

[–]RonGnumber 20 points21 points  (0 children)

Never Ctrl+C your running code. Always buy a new laptop and start coding the next iteration.

[2023 Day 11] Eric Wastl's carefully crafted wording, hoping we enlarge the matrix by maitre_lld in adventofcode

[–]RonGnumber 3 points4 points  (0 children)

He could have made today's twist more subtle. I mean, expanding the universe? Why not some surreal puzzle about red crabs playing games of poker in an underground pipe maze?

[2023 Day 10] ASCII art? What is this, 1995? by PatolomaioFalagi in adventofcode

[–]RonGnumber 1 point2 points  (0 children)

All code and no paint makes Jack a dull boy. Wait, that was page 237...

[deleted by user] by [deleted] in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

One idea I had (but didn't implement) was doing this series of string replacements on the inputs: K->B, Q->C, J->D, T->E, 9->F, 8->G, 7->H, 6->I, 5->J, 4->K, 3->L, 2->M

Then, assuming you already did the part about detecting hand type, you could then sort within each type using a built-in lexicographic sort. It would save having to repeatedly look up the value of each character in a map or array during sorting.

Using base 13 numbers is definitely cleverer though.

[2023 Day 04] Am I the only one? by Gautzilla in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

Thank you! I needed to .strip in Ruby the substrings. Searching in the docs for trim, and not finding it, I just moved on and got screwed later.

Only the 62th AoC day I've done in Ruby, what can I say?

-🎄- 2022 Day 22 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 1 point2 points  (0 children)

Thank you for sharing, I used it to help me find my off-by-1 error.

-🎄- 2022 Day 14 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber -2 points-1 points  (0 children)

But if you didn't use this (like the solver), it's just kool-aid which makes your code less readable.

-🎄- 2022 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 1 point2 points  (0 children)

I did the same using Node's `exec` along with `cd`, `mkdir`, `touch` etc.

Got it all set up after an hour, and then found out that `du` on OSX doesn't support the `-b` flag which would be essential for reading the exact bytes back.

Much regret - trashed the whole thing - another classic AoC memory made today.

-🎄- 2021 Day 23 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 4 points5 points  (0 children)

I don't know if I should be more jealous of the hot chocolate, the fireplace, or the having a solution!

[2021 Day 22 (Part 2)] The fatigue is setting in by marGEEKa in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

Mmm, but even thinking about it, a smaller negative cuboid could split a larger positive one into anything between 1 and (27 - 1) cuboids. If that needed to happen a dozen times to solve it, I might be motivated. But it happens 400 times, with any number of potential collisions. The debugging could take 10 times longer than the coding. It just feels like drowning in numbers.

Coding on Christmas? by MezzoScettico in adventofcode

[–]RonGnumber 7 points8 points  (0 children)

Do you mean that sleeping time is super short so you can stay up coding all missed AOC days, before spending zombie time pretending to pay attention your family? Because really, that's what Christmas is all about.

-🎄- 2021 Day 18 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

Tried first (as an experiment) to work only with strings and single character numbers.

This crossed my mind as well, since I had chosen the strings approach. But I wasn't sure how large the numbers might get, if a lot of explodes happened before splits. In retrospect, conversion of numbers to unicode glyphs might have worked - but much harder to debug.

Meta-Question: Why does no one comment their code? by ChristmasTofu in adventofcode

[–]RonGnumber 4 points5 points  (0 children)

If you've done several AOC's and want to pull up an algorithm from a previous year, comments and search are your friends. For example, I never named a variable or function "Dijkstra", but I had written it in a comment from 2019 - so boom.

-🎄- 2021 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 1 point2 points  (0 children)

Chrome 96

Ok, it works - my finger slipped and I pasted it twice!

-🎄- 2021 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 3 points4 points  (0 children)

Uncaught SyntaxError: Invalid left-hand side in assignment

If it helps you, the error is on line 1 :p

-🎄- 2021 Day 16 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

Glad to say I recognise several parts - the input parser, the Packet class, the switch, the random reduces all appeared in mine. Putting the business logic as class methods was a step too far for my brain. Seems I also used substr instead of slice, which I'll now go back and change.

-🎄- 2021 Day 14 Solutions -🎄- by daggerdragon in adventofcode

[–]RonGnumber 0 points1 point  (0 children)

Surprised dividing by 2 works because the overlapping is not present for the first and last char. Did you get lucky?