Re: [Jprogramming] AOC Day 22 - was Re: Advent of Code Day 14

2022-01-06 Thread 'Mike Day' via Programming
ca 1/3 & 1/8 on time & space - quite an improvement! Well done! Mike Sent from my iPad > On 6 Jan 2022, at 05:42, Raul Miller wrote: > > Mine isn't a whole lot better than that, but I guess it's a little better. > > timespacex 'b22 input' > 24.2392 1.15927e9 > > FYI, > > -- > Raul > >

Re: [Jprogramming] Advent of Code Day 16

2022-01-06 Thread 'Mike Day' via Programming
I’d forgotten that this day was also pretty hard. My “unpack” function (snap!) also delivered the goods for both parts. It works through the message calling either “literal” or “operator”. literal is self-contained, returning a value and an unused message fragment, while operator calls unpack

Re: [Jprogramming] Advent of Code Day 16

2022-01-06 Thread Raul Miller
Mine is recursive: parse calls operator, and operator calls parse. That's why I added a trace mechanism (an echo statement showing the string I used to represent what would happen to the value, along with the value itself, for each packet) -- so that I could visualize what was happening. By the w

Re: [Jprogramming] Advent of Code Day 16

2022-01-06 Thread 'Michael Day' via Programming
So your parse is akin to my unpack. I was going to say that my "operator" and "literal" were both dyadic too,  but checked, and now find I'm wrong.  But "unpack" itself is indeed dyadic;  irs input is initially 0 _ , holding the required part 1 total,  and the number of sub-packets where relev

Re: [Jprogramming] AOC Day 22 - was Re: Advent of Code Day 14

2022-01-06 Thread 'Michael Day' via Programming
I have gone back and improved the code a bit for day 22 part 2 - well,  quite a lot. Part 2 is now solved in ~1 second in ~ 6.5 MB ! (It was 30-60x slower and perhaps 1500x more space-consuming.) Will comment more when Raul presents his comments next week. Mike On 06/01/2022 09:19, 'Mike D

Re: [Jprogramming] AOC Day 22 - was Re: Advent of Code Day 14

2022-01-06 Thread Eugene Nonko
Wait til you get to 24. That one was the most difficult for me. It's not really about programming, more like an old-fashioned logic puzzle. On Wed, Jan 5, 2022 at 4:08 PM 'Michael Day' via Programming < [email protected]> wrote: > I don't think there are any spoilers here. > > Well, I ha

Re: [Jprogramming] AOC Day 22 - was Re: Advent of Code Day 14

2022-01-06 Thread Raul Miller
Personally, I have yet to solve 24. I'm still working on the second half of 23. -- Raul On Thu, Jan 6, 2022 at 1:30 PM Eugene Nonko wrote: > > Wait til you get to 24. That one was the most difficult for me. It's not > really about programming, more like an old-fashioned logic puzzle. > > On Wed

Re: [Jprogramming] AOC Day 22 - was Re: Advent of Code Day 14

2022-01-06 Thread 'Mike Day' via Programming
First half of 23 for me - haven’t seen the light yet! M Sent from my iPad > On 6 Jan 2022, at 19:38, Raul Miller wrote: > > Personally, I have yet to solve 24. I'm still working on the second half of > 23. > > -- > Raul > >> On Thu, Jan 6, 2022 at 1:30 PM Eugene Nonko wrote: >> >> Wait ti

[Jprogramming] Advent of Code Day 17

2022-01-06 Thread Raul Miller
https://adventofcode.com/2021/day/17 Day 17's puzzle was a change of pace from previous puzzles. Instead of a multiline chunk of text representing the puzzle, we got a single line, which looked like this: target area: x=20..30, y=-10..-5 All that would vary would be the numbers. The puzzle itse