r/adventofcode • u/daggerdragon • Dec 14 '17
SOLUTION MEGATHREAD -๐- 2017 Day 14 Solutions -๐-
--- Day 14: Disk Defragmentation ---
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:09] 3 gold, silver cap.
- How many of you actually entered the Konami code for Part 2? >_>
[Update @ 00:25] Leaderboard cap!
- I asked /u/topaz2078 how many de-resolutions we had for Part 2 and there were
83distinct users with failed attempts at the time of the leaderboard cap. tsk tsk
[Update @ 00:29] BONUS
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!
12
Upvotes
View all comments
3
u/ka-splam Dec 14 '17 edited Dec 14 '17
Aieee, PowerShell. This language can get soo ugly when fighting the string/char types and the automatic array unrolling. 16 mins pos 309 for part 1 and 1 hour pos 468 for part 2.
Problems / bugs included:
(y-1),(x-1)and similar, making it only check diagonals instead of never doing that.I think posting here is slightly more interesting for more-or-less the code that actually ran, rather than a total rewrite from later on version. This is only a little tidied
Part 1:
Part 2: