r/adventofcode • u/taliriktug • Dec 02 '15
Spoilers Day 2 solutions
Hi! I would like to structure posts like the first one in r/programming, please post solutions in comments.
15
Upvotes
r/adventofcode • u/taliriktug • Dec 02 '15
Hi! I would like to structure posts like the first one in r/programming, please post solutions in comments.
View all comments
Show parent comment
1
u/[deleted] Dec 07 '15
Thanks for the comments! You're totally right about the face_areas thing. That's a much better choice of name than just "sides".
And I see what you're saying about using a list comprehension rather than the functional map.
The testable units have been incredible. I almost never write code in a TDD way, so it's been pretty nice to write these small units, stick them together, and know with pretty good certainty that my answer's correct before I submit it. Especially with Day 6, because I got a few off-by-one errors with the ranges, and ended up changing from mapping on/off to 1/-1 and instead doing 1/0. Once I updated my tests, then it was nice knowing that I hadn't screwed it up along the way.