Re: [Jprogramming] Advent of Code Day 24

2022-01-15 Thread Raul Miller
Also, after reflection, it turns out that getting rid of the if statement was straightforward: BLOCK=: {{ W=: x{::digits X7=: W~:/(x{B)+26|y ((W+x{A)*X7)+(1+25*X7)*"(X7 <.&#&$ t)t=.<.y%x{C }} By the way, in case it was not obvious -- the 7 (in X7) refers to the line number of that assignme

Re: [Jprogramming] Advent of Code Day 24

2022-01-15 Thread 'Michael Day' via Programming
... and it's one of those "days" that part 2 is ridiculously easy cf part 1 !!! Mike On 15/01/2022 21:15, 'Michael Day' via Programming wrote: Yes, that's my guess.  I called them p q & r,  and found that p = 1 or 26 as q is positive or negative. So: having got one machine to run 14 times on

Re: [Jprogramming] Advent of Code Day 24

2022-01-15 Thread 'Michael Day' via Programming
Yes, that's my guess.  I called them p q & r,  and found that p = 1 or 26 as q is positive or negative. So: having got one machine to run 14 times on different values of p q r and the previous Z, I worked back from Z = 0 output on the 14th machine,  saving which W & Zs gave rise to 0,  then us

[Jprogramming] Advent of Code Day 25

2022-01-15 Thread Raul Miller
https://adventofcode.com/2021/day/25 This is the end of the advent of code series for last year. It was a quick wrap up. Here, the puzzle was about waiting for sea cucumbers to get out of the way so you could land your submarine and launch santa's sleigh (which makes about as much sense as santa,

Re: [Jprogramming] Advent of Code Day 24

2022-01-15 Thread Raul Miller
Actually, another caution here: it might be that other people's puzzle inputs used a different block structure from my block structure. Probably not -- it's probably the case that only my A, B and C values differed for different people. But .. that's just "probably" because I haven't looked at oth

Re: [Jprogramming] Advent of Code Day 24

2022-01-15 Thread Raul Miller
I've got this solved now, Eugene Nonko put me on the right path here. The trick, from my perspective, was to convert the machine code into executable J. And, to ensure that I could use J's dimensionality to manage multiple tests at the same time. Specifically, I parameterized the three "block s