53
SOLUTION MEGATHREAD-🎄- 2019 Day 3 Solutions -🎄-(self.adventofcode)
submitted 6 years, 1 month ago* (edited 14 minutes after) by daggerdragon to /r/adventofcode (134.8k)
since 6 years, 1 month ago
4 of 4
Tip Reveddit Real-Time can notify you when your content is removed.
your account history
Tip Check if your account has any removed comments.
view my removed comments you are viewing a single comment's thread.
view all comments


Racket
Yey, I managed this as well in racket It's probably suboptimal, since I managed to make it faster in python, which it shouldn't be, but it was a fun excercise, at least it's spitting out the right answer.
I like yours a lot better than mine this time. I got home late last night, fell asleep in the middle of it and then the next day realized that some simplifying instructions I made for part 1 made part 2 harder (the "direction" component of the segments was hastily added in after reading part 2)
I see you also took advantage of matching on structs. :)
Also, I love the threading macros, makes it so much easier to read and think about the code, now I just need clojure's syntax for hashmaps and I'm almost comfortable :p
Yeah, got a bit complex, but hey I do that a lot too, I was struggling and redoing my matching function 4-5 times before I got it right, I do recalculate some values too often, so I would probably really benefit from making a global, but then that feels so dirty as well :)
Matching is really nice, and I really enjoy simple structures, it makes thinking about a problem so much easier to me, since I don't forget where I am as often in a larger function :p