Day 17 part 2 was fun.
I guess all programs were similar
Taking bits from A 3by3
This bits are xor with 2 constants to get an index and a value
Bits from a at this index are xor with value before output
Solver for part 2 is trying numbers in depth first from 0 to 7.
Each value impose further bits, so keep a mask of fixed bits.
At each step validate value that is tried with already set bits, this cuts all invalid branches early and terminates in less than 100 microseconds
=> More informations about this toot | More toots from thinkb4coding@mastodon.social
The only difference is ptobably the 2 constants used to xor, and maybe which registers are used for comptation
=> More informations about this toot | More toots from thinkb4coding@mastodon.social
And the second number of the opcode that takes no argument also.
=> More informations about this toot | More toots from thinkb4coding@mastodon.social
It was also important to notice that all operations are bitwise operations.
X mod 8 is X & 0b111
X div 2^N is X shift right by N
The rest is just xor
=> More informations about this toot | More toots from thinkb4coding@mastodon.social This content has been proxied by September (ba2dc).Proxy Information
text/gemini