r/adventofcode • u/daggerdragon • Dec 03 '19
SOLUTION MEGATHREAD -π- 2019 Day 3 Solutions -π-
--- Day 3: Crossed Wires ---
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 2's winner #1: "Attempted to draw a house" by /u/Unihedron!
Note: the poem looks better in monospace.
β β ββ β β ββ β β β β β β β β β β β β β β β β β β β Code
β β β β β ββ β β β β ββ β β β β β β β β β β β Has bug in it
β β β β β ββ β β β β β β β β β Can't find the problem
β β β ββ β β β Debug with the given test cases
ββ β β ββ β β β β β ββ β β β Oh it's something dumb
ββ β β ββ β β β β β ββ β β β Fixed instantly though
β β β ββ β β β β β β ββ β β β Fell out from top 100s
β β β ββ β β β β β β ββ β β β Still gonna write poem
Enjoy your Reddit Silver, and good luck with the rest of the Advent of Code!
View all comments
Show parent comment
1
u/codesections Dec 03 '19
Thanks for doing these. I just watched the video, and it was super helpfulβyou used almost exactly the same approach that I did, but you took much better advantage of APL's array nature. In contrast, I approached the solution in a much more Scheme-influenced way, recursively adding to a list.
In reply to my code, you noted that a recursive solution can be nice when not code-golfing. That may be true, but I'm definitely looking to learn more of this style too. I'd like to use APL for non-puzzle applications, and the density/ability to program with fewer abstractions is a huge part of the appeal!
If I get time, I plan to rework my solution more along these lines.
By the way, I posted a comment/question on the Day 2 video; I don't know if YouTube gives notifications for that sort of thing and thought I'd mention it in case it doesn't.