Re: [Jprogramming] Questions on Advent of code Day 1

2022-12-02 Thread Raul Miller
Actually, I originally had LF,LF until someone pointed out that LF2 was in stdlib. That said, other parsing approaches for the day 1 data are perfectly viable. For example: +/|:".@;S:1 cutLF each cutpara data -- Raul On Fri, Dec 2, 2022 at 7:25 PM 'Mike Day' via Programming wrote: > > LF2

Re: [Jprogramming] Questions on Advent of code Day 1

2022-12-02 Thread 'Mike Day' via Programming
LF2 ... new to me! I was a bit thrown by the parsing of the trivial example being different from that for the data file; however that's likely a by-product of copy&paste on the example versus downloading the file. Anyway, I wasn't expecting LF,LF (or LF2); the usual LF cut ... missed the e

Re: [Jprogramming] Questions on Advent of code Day 1

2022-12-02 Thread Raul Miller
Here's the parsing routine I used for day 1: parse=: {{ +/@(__&".;._2);._2 (y,LF) rplc LF2;LF,'/'}} Its y argument would be the raw text of the input.txt provided for day 1. I hope this makes sense, -- Raul On Fri, Dec 2, 2022 at 11:36 AM Jaume wrote: > > Hello all > > I've been trying to da

[Jprogramming] Questions on Advent of code Day 1

2022-12-02 Thread Jaume
Hello all I've been trying to dabble in J for quite some time, but I still haven't got the hang of it, so I'm trying (not for the first time) to go in deep trying to solve each day. Alas sometimes it feels like hitting my head against the wall, and so I come to you with what I tried and what I la