Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day 23 #6

Open
annakrystalli opened this issue Jan 9, 2018 · 3 comments
Open

Day 23 #6

annakrystalli opened this issue Jan 9, 2018 · 3 comments

Comments

@annakrystalli
Copy link
Owner

No description provided.

@annakrystalli
Copy link
Owner Author

Coprocessor Conflagration: Okay, this was awful. No code will help you, I think. I had to study the source code and figure out what's going on.

@tjmahr
Copy link

tjmahr commented Jan 12, 2018

Here's a redacted version of what's in my R script. Indenting and commenting helped.

# I solved it by studying and annotating the code. Crucially, h increments if f
# is 0 which happens if [...spoiler removed...] 
# 
# 01 set b 57
# 02 set c b
# 03 jnz a 2         03-05
# 04 jnz 1 5         04-09
# 05 mul b 100
# 06 sub b -100000
# 07 set c b
# 08 sub c -17000
#   09 set f 1
#   10 set d 2
#     11 set e 2
#       12 set g d
#       13 mul g e
#       14 sub g b
#
# [...spoiler removed...]
#
#   27 set g b
#   28 sub g c             keep looping until b is as big as c
#   29 jnz g 2             29-31
#   30 jnz 1 3             30-EXIT
#   31 sub b -17
#   32 jnz 1 -23           32-09

@annakrystalli
Copy link
Owner Author

Thanks! This is really useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants