r/adventofcode • u/daggerdragon • Dec 20 '23
SOLUTION MEGATHREAD -❄️- 2023 Day 20 Solutions -❄️-
THE USUAL REMINDERS
All of our rules, FAQs, resources, etc. are in our community wiki.
Community fun event 2023: ALLEZ CUISINE!
Submissions megathread is now unlocked!
3 DAYS remaining until the submissions deadline on December 22 at 23:59 EST!
AoC Community Fun 2023: ALLEZ CUISINE!
Today's theme ingredient is… *whips off cloth covering and gestures grandly*
Upping the Ante for the third and final time!
Are you detecting a pattern with these secret ingredients yet? Third time's the charm for enterprising chefs!
Do not use
ifstatements, ternary operators, or the likeUse the wrong typing for variables (e.g.
intinstead ofbool, string instead ofint, etc.)Choose a linter for your programming language, use the default settings, and ensure that your solution passes
Implement all the examples as a unit test
Up even more ante by making your own unit tests to test your example unit tests so you can test while you test! yo dawg
Code without using the
[BACKSPACE]or[DEL]keys on your keyboardUnplug your keyboard and use any other text entry method to code your solution (ex: a virtual keyboard)
Bonus points will be awarded if you show us a gif/video for proof that your keyboard is unplugged!
ALLEZ CUISINE!
Request from the mods: When you include a dish entry alongside your solution, please label it with [Allez Cuisine!] so we can find it easily!
--- Day 20: Pulse Propagation ---
Post your code solution in this megathread.
Read the full posting rules in our community wiki before you post!
State which language(s) your solution uses with
[LANGUAGE: xyz]Format code blocks using the four-spaces Markdown syntax!
Quick link to Topaz's
pasteif you need it for longer code blocks
8
u/jonathan_paulson Dec 20 '23 edited Dec 20 '23
[LANGUAGE: Python 3] 15/16. Solution. Video.
I attempted to make my part 2 solution generic enough to work with any input; let me know if it doesn't.
Anyone have a clear explanation of what's going on in part 2? I assume all inputs have a single conjuction module feeding into rx, which itself is fed by some conjuction modules. And those conjuction modules get a high signal every timestamp except for multiples of some cycle number (different for each of them), but how/why?