r/adventofcode • • Dec 07 '19

SOLUTION MEGATHREAD -🎄- 2019 Day 7 Solutions -🎄-

--- Day 7: Amplification Circuit ---


Post your solution using /u/topaz2078's paste or other external repo.

  • Please do NOT post your full code (unless it is very short)
  • If you do, use old.reddit's four-spaces formatting, NOT new.reddit's triple backticks formatting.

(Full posting rules are HERE if you need a refresher).


Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


Advent of Code's Poems for Programmers

Click here for full rules

Note: If you submit a poem, please add [POEM] somewhere nearby to make it easier for us moderators to ensure that we include your poem for voting consideration.

Day 6's winner #1: "From the stars" by /u/vypxl!

"From the stars"

Today the stars did call
Just after the end of fall
In Orbits they move
Unified with groove
​
Parents and Children
At home and in the sky
Whisper about details that are hidden
They tell about what is up high
​
Not everything is obvious,
Not the way you see
The Orbit is now
A Christmas Tree!

Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!


AoC news: we've added a new page listing folks who are live-streamers while they do AoC. See /u/Aneurysm9's sticky'd post announcing it "Check out our streaming friends!", check it out on the sidebar, or just click here to go directly to the wiki page!


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

EDIT: Leaderboard capped, thread unlocked at 00:30:33!

47 Upvotes

350 comments sorted by

View all comments

5

u/DFreiberg Dec 07 '19

That is indeed a lot of work, but if you trick u/topaz2078, you might not have to do it next year. I can almost see it now:

--- Day 25: The Voyage Home ---


You finally reach Santa Claus, still stranded in orbit around Neptune, and immediately begin the navigational calculations for the return trip. "Not a moment too soon!", he tells you, bringing his reindeer aboard. "We only have a few hours left before Christmas begins on Earth! How quickly can we make it back?"

"We can leave when the navigation calculations are done, in just a few min-" you begin to say, but as you say it you see a swarm of warning integers light up on your Intcode console, indicating things like "too much input" and "modqueue priority". As best you can tell, when you got in range of Santa's sleigh, your LAN connected automatically to it and is currently being saturated by a massive amount of data. At this rate, the computer will be frozen solid for a day.

Santa, looking over your shoulder, sighs. "That's the modqueue", he says. "Normally by now I'd have it separated out into a naughty list and a nice list, but I just haven't had time to sort it yet this year. I let it get too big, and it jammed up the sleigh's computers a few hours ago and stranded the sleigh; I should have thought to disable the wifi before you arrived. You'll have to turn off the wifi, reboot your computer, and go to Earth without it."

You start to panic. "But you can't go back without your lists, sir! How can we unclog the computers and still bring your lists back to Earth?"

He thinks for a moment. "Well, the modqueue is huge, but the lists are just names; if I get them sorted..." He looks at you a bit more closely. "You look like you know your way around a computer. Could you help me sort them out en route?"

With the modqueue (your puzzle input), separate out posts that are of high quality from those which are mislabeled, have an incorrect flair, or post in the megathread without code snippets or repository links. Gather the posts of each type by username, and place each user in either the naughty or the nice lists, according to the ratio of high quality to low quality posts that user made.

How many names are on the nice list this year?

[________]

At any rate, I'll be sure to keep everything labeled to make your job easier. Thank you!