r/adventofcode • u/daggerdragon • Dec 23 '19
SOLUTION MEGATHREAD -🎄- 2019 Day 23 Solutions -🎄-
--- Day 23: Category Six ---
Post your full code 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.
- Include the language(s) you're using.
(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
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 22's winner #1: "Scrambled" by /u/DFreiberg
To mix one hundred trillion cards
One-hundred-trillion-fold
Cannot be done by mortal hands
And shouldn't be, all told.The cards make razors look like bricks;
An atom, side to side.
And even so, the deck itself,
Is fourteen km wide.The kind of hands you'd need to have,
To pick out every third,
From cards that thin and decks that wide?
It's, plain to say, absurd!And then, a hundred trillion times?
The time brings me to tears!
One second each per shuffle, say:
Three point one million years!Card games are fun, but this attempt?
Old age will kill you dead.
You still have an arcade in here...
How 'bout Breakout instead?
Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!
Message from the moderators:
Only three more days to go! You're badass enough to help Santa! We believe in you!
View all comments
Show parent comment
1
u/sim642 Dec 23 '19
I didn't mean interleaving the Xs and Ys at all. If two computers output a packet to a third computer, then there's still an ambiguity which of the two should be first in the queue. Depending on the order of making execution steps with the computers, either outcome is technically possible. Even when you run all 50 computers in perfect lockstep, it's still possible they produce a packet to the same target at the very same step.
It seems that this won't matter for the programs we're given, but the only way of knowing that is solving the task first, by having to make some assumption about the way to run the execution steps, which in general is a pretty terrible way of solving a problem: making your own assumptions out of thin air.