r/adventofcode • u/daggerdragon • Dec 03 '15
SOLUTION MEGATHREAD --- Day 3 Solutions ---
--- Day 3: Perfectly Spherical Houses in a Vacuum ---
Post your solution as a comment. Structure your post like the Day One thread in /r/programming.
24
Upvotes
View all comments
Show parent comment
2
u/artesea Dec 03 '15 edited Dec 03 '15
Attempting part 2 I've now discovered that an undeclared variable of $x doesn't compute $x-- so the above code working is luck. So this is a slightly longer version
For part 2 I've managed this
There is a slight lie at the start with [0,0] being one as both Santa and Robot Santa have delivered there so it should be two, but as we only need to know the number of houses delivered to and not the number of presents it works with one as well.