Day 13: Claw Contraption
Megathread guidelines
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL
FAQ
- What is this?: Here is a post with a large amount of details: https://programming.dev/post/6637268
- Where do I participate?: https://adventofcode.com/
- Is there a leaderboard for the community?: We have a programming.dev leaderboard with the info on how to join in this post: https://programming.dev/post/6631465
I had to borrow some of y’alls code to finish part 2. My approach and all the attempts I did at trying to get the slopes of lines and such couldn’t get it high enough.
I thought to move from the prize along it’s furthest away axis until I got to the intersection of the slope of the two buttons.
I thought that maybe that wasn’t the cheapest way, so I fiddled around with the order of button A and B, but still couldn’t get it high enough.
It looks like this group was mostly doing the cross product of the prize to the two buttons. I’m too dumb to realize how that would work. I thought you’d want to move along the furthest away axis first, but maybe it doesn’t matter.
If anyone can see if I did anything obviously wrong, I’d appreciate it. I normally don’t like to take code without fixing whatever it is I was doing since it always bites me in the butt later, but here I am.
F#
expand for source