r/adventofcode • • Dec 12 '16

SOLUTION MEGATHREAD --- 2016 Day 12 Solutions ---

--- Day 12: Leonardo's Monorail ---

Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/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".


MUCH ADVENT. SUCH OF. VERY CODE. SO MANDATORY. [?]

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!

8 Upvotes

159 comments sorted by

View all comments

Show parent comment

2

u/TenjouUtena Dec 12 '16

How much savings did splitting the cpy and jnz opcodes save? I've got a reasonable approximation of most of what you're doing here: https://github.com/TenjouUtena/AdventOfCode2016/blob/master/12/run2.py and my next step was to try and remove the value function as needed, but I wondered if it was 'worth' it. mine takes ~24 seconds as tested internally by the code. Also the 'compilation' step takes no measurable time for my code.

1

u/wzkx Dec 12 '16

I don't know really. Probably not much anyway. I just know that in real CPUs there are different instructions for that stuff. So why not use that knowledge :)