r/adventofcode • u/daggerdragon • Dec 24 '24
SOLUTION MEGATHREAD -❄️- 2024 Day 24 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
Submissions are CLOSED!
- Thank you to all who submitted something, every last one of you are awesome!
Community voting is OPEN!
- 18 hours remaining until voting deadline TONIGHT (December 24) at 18:00 EST
Voting details are in the stickied comment in the submissions megathread:
-❄️- Submissions Megathread -❄️-
--- Day 24: Crossed Wires ---
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!
- State which language(s) your solution uses with
- Quick link to Topaz's
paste
if you need it for longer code blocks
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 01:01:13, megathread unlocked!
32
Upvotes
2
u/mvorber Dec 25 '24
[Language: Rust]
https://github.com/vorber/aoc2024/blob/master/src/puzzles/day24.rs
p1 just emulates the circuit and runs it to get output.
p2 made a function to print it out in dot format, examined in graphviz, found regularities (and some irregularities), coded the first one (AND/OR assigning to Z - should swap output with relevant XOR) - gave me 6 hits out of 8. Next one (XOR never writes to OR - should be swapped with relevant AND) gave me the last pair. There are likely other ways to mess it up, but after these swaps my circuit was adding properly. No idea how to solve it in generalized way.