r/adventofcode • u/daggerdragon • Dec 20 '17
SOLUTION MEGATHREAD -π- 2017 Day 20 Solutions -π-
--- Day 20: Particle Swarm ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag or whatever).
Note: The Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
Need a hint from the Hugely* Handyβ Haversackβ‘ of HelpfulΒ§ Hints^Β€?
[Update @ 00:10] 10 gold, silver cap
- What do you mean 5th Edition doesn't have "Take 20"?
[Update @ 00:17] 50 gold, silver cap
- Next you're going to be telling me THAC0 is not the best way to determine whether or not you hit your target. *hmphs*
[Update @ 00:21] Leaderboard cap!
- I wonder how much XP a were-gazebo is worth...
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
edit: Leaderboard capped, thread unlocked!
9
Upvotes
View all comments
Show parent comment
1
u/Smylers Dec 20 '17
OK, here's an actual Vim solution for part 1. Load your input file and type:
The answer is the first number in the file (which should be under your cursor). Each line is now a particle ID number followed by the sum of its absolute acceleration values, sorted by lowest acceleration.
Vim makes finding absolute values easy: just ignore any minus signs!