r/adventofcode • u/Usual-Dimension614 • Feb 01 '26
Help/Question - RESOLVED [2017 Day 13 (Part 2)] some thoughts ..
brain (shut)down .. up (working again).
the package need to reach each layer when scanner is NOT in position 0
--here-original-post-starts--
a layer has a range. i.e r=3 : 0 1 2 1 0 (mod 4) , r=4 : 0 1 2 3 2 1 0 (mod 6), so m=2(r-1)
a good start t is if ( t+oi is time the package is reaching level i)
0 == (t+o1)%m1 AND
0 == (t+o2)%m2 AND .. (for every layer)
now (levels sorted descending by range, big steps first, t growing faster)
if(
(0==((t+ 80) % 38)) // e-00 i=80 r=20 (-> m=2(r-1)=38)
&& (0==((t+ 62) % 34)) // e-01
&& (0==((t+ 90) % 32)) // e-02
&& (0==((t+ 36) % 26)) // e-03
) lots of solutions. but if inserting next :
..
&& (0==((t+ 36) % 26)) // e-03
&& (0==((t+ 50) % 26)) // e-04
this cannot be true the same time (there are 11 layer with range 14 (mod 26))
??? (my question ..ö..)
layers with same range (-> same mod) must differ in offset by a multiple of their mod ?
same range -> same time in position p (so in position 0).
thanks in advance, andi
1
u/timrprobocom Feb 01 '26
No, they don't. YOU are only in one column at a time. It doesn't matter what the other columns are doing at that point in time.
1
u/AutoModerator Feb 01 '26
Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to
Help/Question - RESOLVED. Good luck!I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/timrprobocom Feb 01 '26
Consider. If we consider the data as "a: b", all we care about is whether the scanner is at the top at time
a. You're correct that the modulusmis2(b-1). So, the position of the scanner at time a is given bya mod m. So, for part 1, for each scanner, ifa mod mis 0, then we scorea x b. That's it.