java: add solution for year 2016, day 25 #118
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
That concludes year 2016!
This final assembunny problem could of course be solved by reverse engineering, but I did a more "soft reverse engineering" this time. Instead of trying to study the code in detail, I just ran the program for a couple of inputs (i.e. values of
a
), and noted the values of the registers as well as what was output. From there I solved the problem -- read more in the comments of thepart1
function.I think it is a little bit sad that all of these assembunny problems did not really require you to implement and use your VM -- you could just reverse engineer everything instead. I liked year 2019 better that way: you really had to implement the intcode VM there, since several of the problems more heavily relied on actually running intcode programs, not simply reverse engineer them.
Anyway, rant over. I am happy that I am done with year 2016 now! Now there is only a few days each left in years 2017 and 2018 before I have completed all of the puzzles.