Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Raul Miller
Yes... we have diverged into a tangent. Nevertheless, this makes it clear why you had difficulty splitting on the blank line... Thanks, -- Raul On Mon, Dec 5, 2022 at 3:41 PM 'Mike Day' via Programming wrote: > > In my particular file, these two lines appear to be adjacent: > 1 2 3 4

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread 'Mike Day' via Programming
In my particular file, these two lines appear to be adjacent: 1 2 3 4 5 6 7 8 9 move 3 from 2 to 5 Sorry - this isn't of much interest for AOC as such! Mike Sent from my iPad > On 5 Dec 2022, at 20:15, Raul Miller wrote: > > It looks like the file transfer also is removing t

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Raul Miller
It looks like the file transfer also is removing trailing spaces on each line. Is it also removing the blank line? (It's difficult to tell from the index values you listed. But it seems like either it must have removed the blank entirely or it must have used some other characters to represent the

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread 'Michael Day' via Programming
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, 

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Raul Miller
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)

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread 'Michael Day' via Programming
I looked for a match with the line reading  1 2 3 ie break =. I. y E.~ ' 1 2 3' Does that help? Mike On 05/12/2022 15:58, Jaume wrote: Hello again. I managed to solve day 3 and 4, so maybe when I clean up my solutions I will ask to review them. But right now I have a problem and some question

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Jaume
I don't know about the bolded text. It could be, haven't been much active. I can't see where the value is transmitted in your code. Mostly I don't understand the {. move }. part. In the end I managed it using an accumulator variable. Didn't like it much but... Missatge de 'robert therriault' via

Re: [Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread 'robert therriault' via Programming
Hi Jaume, To begin, I cut and paste the data into a temp.ijs file in the jQt environment, so my hat is off to you for taking a purer approach. For the initial stacks I created ascii coded integer vectors (gets around the issues with character manipulation) For the move commands, I defined take,

[Jprogramming] Questions Advent of Code 2022 Day 5

2022-12-05 Thread Jaume
Hello again. I managed to solve day 3 and 4, so maybe when I clean up my solutions I will ask to review them. But right now I have a problem and some questions on the first part of day 5. Main things I need in bold, mainly the last one. Feel free to code review this message as much or as little a