<Advent of Code 2024 day 17> (no spoilers) :thread...
# advent-of-code
a
Advent of Code 2024 day 17 (no spoilers) 🧵
d
I see one obvious pattern in the output but it is not narrowing the range of registers to check enough
Am I supposed to be able to reverse the execution of the program from the output?
j
I thought about that too, but did not want to do it, for my input every execution stops after <100 steps in the simulation, I'm brute forcing atm. My estimates say I need ~1h to try all.
d
I don’t think your estimate is correct. What range are you brute forcing over.
j
All positiv integers, so (0..Int.MAX_VALUE), to be honest, I'm kinda tired to detect cycles or reverse compute the program.
d
your estimate is not correct 😞
n
For me, no positive integer produces the solution. Thus, looks like it's a Long
And btw: testing all positive Int takes me less than 2.5 minutes
d
It is a long, yes. We are discussing how to solve it in the spoiler thread
No one has solved it yet
On here
OK it’s been solved
By @Michael de Kaste
s
Anyone got any stupid/obvious bugs from part1 to share? My solution passes the sample and all examples provided in the text, but produces wrong result on my own input 😢
f
@Sergei Petunin might want to look into
bdv
(commenting my impl of
bdv
out makes test and other examples still work but real input fail)
p
@Sergei Petunin read carefully about the difference between
literal operand
and
combo operand
it was my bug 😉
and about part2: I've tried already 0..Int.MAX_VALUE range, now I'm running Int.MAX_VALUE..Long.MAX_VALUE and if it does not produce a result till 16 I will try something different 😅
s
@Fredrik Rødland same for me, but it looks like I don't even have
bdv
in my input 😕
(The numerator is still read from the
A
register.)
aaaaargh
thanks, folks
👍 2
l
Any hints on the solution to part 2? Brute Force or Reverse it?
d
You cannot brute force it
You must understand what the program is doing
To some degree
j
Yeah brute forcing it did not work out, had to understand what is really happening.
j
As much difficulty as I had solving this, I do like that the result included this little code snippet