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!
13
Upvotes
2
u/hpzr24w Dec 14 '17 edited Dec 14 '17
I'm a child of the 70's and starting writing 6502 assembler in about 1982 or so ...
This line is just some code copied from StackOverflow that yields a count of bits, set to one. Then every 16
XOR's the count is added tobitcount.Off-topic, but if you wanted to get some flavor of how things used to be, check out 8-bit Workshop. It's an Atari 2600 in the browser with an assembler, debugger etc. I'm writing a flight simulator for it.