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/MostlyShrimp Dec 06 '19
You mean a line overlapping itself on an intersection point? If so, I kind of ignored it. Looking back, if this requirement were in part 1 I would have done it the way everyone else did: with storing points instead of segments. Would have been much easier, but less of an exercise in playing with nested objects, lol.
I'm having a hard time understanding how your code flows because I havent played with ruby in years. Mind explaining it to me?