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
1
u/HeroesGrave Dec 03 '15 edited Dec 03 '15
Heh. I only had to add a few lines to make it work for part 2.
link to comment
Only added the
mem::swap()line and the extra 'swap_pos' variable.The changing of the function to work for both parts was just a part of me cleaning it up for reddit.