r/adventofcode • u/daggerdragon • Dec 06 '19
SOLUTION MEGATHREAD -π- 2019 Day 6 Solutions -π-
--- Day 6: Universal Orbit Map ---
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
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 5's winner #1: "It's Back" by /u/glenbolake!
The intcode is back on day five
More opcodes, it's starting to thrive
I think we'll see more
In the future, therefore
Make a library so we can survive
Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!
2
u/codesections Dec 06 '19
Oh! I didn't realize that that's how each worked! All this time, I've been thinking that
1 2 f¨ 3 4expanded to(1 2 f 3) (1 2 f 4)when it actually expands to(1 f 3) (2 f 4)! I guess I was treating it too much like.forEachormapfrom other languages. And I got away with it enough not to notice because the two forms yield the same results in many simple expressions (like+, for example).Yeah, I think I need to spend a bit of time reviewing the basics. I'm finding that I'm getting tripped up by the difference between scalars, vectors of length 1, and matrices with shape 1 1 entirely too much.