Interesting. I hadn't spotted the double LF, which, as I now know,
has its own moniker, LF2.
I'd started looking at the puzzle on this laptop, then moved my
proto-script and the datafile to
the iPad as I was going out for a few hours.
Ian Clark might note that, and will understand why, I found different
positions for LF:
on the Windows 11 laptop, J904 beta-g:
I.LF = 350{.data
35 71 107 143 179 215 251 287 323 324 343
(with the double LF at 323 324)
and on the iPad (iOS 15.xxx) running Jios 903.1 release 52:
I.LF = 350{.data
27 55 87 119 155 191 227 263 298 317 336
(with no double LF)
- which is possibly why I didn't spot it!
However, this turns out to be an artefact of transferring data from
laptop to iPad.
I've just logged back in to day 5 for the purpose of this message, and
downloaded
the data from the aoc site to the tablet. It then duplicates the LF
indexes as found
on the laptop.
Warning to self!
BTW, my first nearly successful pass on the example gave MCD as the
answer for part 1
before I realised I needed to reverse the removed items as the
CrateMover 9000 could only
manage individual crates, so part 2 was trivial by comparison!
Mike
On 05/12/2022 16:45, Raul Miller wrote:
To find the splitting point in the file, I used:
split=. 2+I. LF2 E. y
To handle the moves, converted the part after the split to a rank 2
array of characters (one row per line), defined
to=: ,
from=: ,
And used:
".parse sample
and
".parse input
This means that I had a (slightly) different 'move' verb for part 2
from what I had for part 1.
FYI,
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm