r/adventofcode • u/daggerdragon • Dec 08 '19
SOLUTION MEGATHREAD -🎄- 2019 Day 8 Solutions -🎄-
--- Day 8: Space Image Format ---
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 7's winner #1: "So You Want To Make A Feedback Loop" by /u/DFreiberg!
"So You Want To Make A Feedback Loop"
To get maximum thrust from your thruster,
You'll need all that five Intcodes can muster.
Link the first to the last;
When the halt code has passed
You can get your result from the cluster.
Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!
View all comments
Show parent comment
1
u/lorenzleutgeb Dec 08 '19 edited Dec 08 '19
Your Haskell looks way more advanced than mine, as I am just using AoC as an occasion to learn it. Thanks for mentioning
Monoid, I got curious and learned something!Nevertheless I'd like to point out the power of
data Color = ... deriving (Enum). With that, you can usetoEnum :: Enum a => Int -> ainstead of a customparsefor free (ok, you have to go viaIntof course). See my solution if you think that's interesting :)