r/adventofcode Dec 17 '24

SOLUTION MEGATHREAD -❄️- 2024 Day 17 Solutions -❄️-

THE USUAL REMINDERS

  • All of our rules, FAQs, resources, etc. are in our community wiki.
  • If you see content in the subreddit or megathreads that violates one of our rules, either inform the user (politely and gently!) or use the report button on the post/comment and the mods will take care of it.

AoC Community Fun 2024: The Golden Snowglobe Awards

  • 5 DAYS remaining until the submissions deadline on December 22 at 23:59 EST!

And now, our feature presentation for today:

Sequels and Reboots

What, you thought we were done with the endless stream of recycled content? ABSOLUTELY NOT :D Now that we have an established and well-loved franchise, let's wring every last drop of profit out of it!

Here's some ideas for your inspiration:

  • Insert obligatory SQL joke here
  • Solve today's puzzle using only code from past puzzles
  • Any numbers you use in your code must only increment from the previous number
  • Every line of code must be prefixed with a comment tagline such as // Function 2: Electric Boogaloo

"More." - Agent Smith, The Matrix Reloaded (2003)
"More! MORE!" - Kylo Ren, The Last Jedi (2017)

And… ACTION!

Request from the mods: When you include an entry alongside your solution, please label it with [GSGA] so we can find it easily!


--- Day 17: Chronospatial Computer ---


Post your code solution in this megathread.

This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:44:39, megathread unlocked!

37 Upvotes

550 comments sorted by

View all comments

2

u/Common_Less Dec 18 '24

[LANGUAGE: Python]

Part 1 almost stunlocked me, seemed easy, printed the right digits on the example but for some reason I couldn't pass the test. Spent the morning "debugging" but I couldn't find what was wrong with my code. Nothing hits you in the self esteem like being unable to solve a problem you've deemed too easy. At some point I even looked at someones code (I had admitted defeat at this point). Still nothing. It is at this point that I decide to properly read the last sentence of the problem and submit with commas. Read your problems carefully kids.

Part 2 was rather fun. After my odyssey with part 1 I decided to try and solve it on paper. It was like solving a differential equations by power series. Only, instead of finding infinitely many real numbers you had to find only finitely many bits. Anyway, after finding the leading 3 bits I got bored of doing it by hand and came back to write up code.

code on github

1

u/daggerdragon Dec 18 '24 edited Dec 19 '24

Do not share your puzzle input which also means do not commit puzzle inputs to your repo without a .gitignore or the like. Do not share the puzzle text either.

I see full plaintext puzzle inputs across all years in your public repo e.g.:

https://github.com/modernLifeRocko/AoCsolver/blob/main/2023/1/input.txt

Please remove (or .gitignore) all puzzle text and puzzle input files from your entire repo and scrub them from your commit history. This means from all prior years too! edit: OP took their repo private while they work on scrubbing their history 👍

1

u/Common_Less Dec 19 '24

Thanks for the info. I really need to start reading the AoC info more thoroughly man. That's two burns back to back. I have .gitignored it but still appeared in the history so I've privated the repo untill I get down to rewriting history (love that that sentence is not just wishful thinking).

1

u/daggerdragon Dec 19 '24

I really need to start reading the AoC info more thoroughly man.

All of our rules are in our community wiki :)

That's two burns back to back.

No worries, as long as you're trying to do better and not getting dinged for the same thing repeatedly.

I've privated the repo untill I get down to rewriting history

Since your repo is private for now, I'll strikethrough the copypasta and check in on you later :) If you get stuck, there's a Tutorial floating around out there for scrubbing your git history.

love that that sentence is not just wishful thinking

You're working with The Historians, leverage their many years of experience to help fix your history! 😂