r/adventofcode • u/daggerdragon • Dec 15 '19
SOLUTION MEGATHREAD -🎄- 2019 Day 15 Solutions -🎄-
--- Day 15: Oxygen System ---
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.
(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 14's winner #1: "One Thing Leads To Another" by /u/DFreiberg!
Poem tl;dpost (but we did r, honest!), so go here to read it in full
Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!
On the (fifth*3) day of AoC, my true love gave to me...
FIVE GOLDEN SILVER POEMS (and one Santa Rocket Like)
- Day 10: "untitled poem" by /u/Yardboy
- Day 11: "A ROBOT TO THE RESCUE" by /u/mariusbancila
- Day 12: "Symmetry" by /u/DFreiberg
- Day 13: "untitled poem" by /u/captainAwesomePants
- Day 14: "Alchemy" by /u/captainAwesomePants (again! he's too awesome for his pants!)
- 5-Day Best-in-Show: "The Hunting of the Asteroids" by /u/DFreiberg
TBD because we forgot today % 5 == 0, we'll get back to you soon!
Enjoy your Reddit Silver/Gold, and good luck with the rest of the Advent of Code!
View all comments
Show parent comment
4
u/glguy Dec 15 '19
Being pure is a property functions can have that means the only thing a function does is return a value. It doesn't depend on any other external, mutable state. Given the same argument the function will return the same result.
In my solution when you run an intcode program you get one of 3 outcomes:
When the program needs an input you get a function that you can apply to different inputs however you like. I use this to make it easy to try different inputs in a breadth-first search.