Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Jimmy Gauvin
Nice solution, 3D coordinates are more direct (much less messy) than axial coordinates. On Sun, Dec 17, 2017 at 2:57 PM, Henry Rich wrote: > I haven't been following this thread but has gone on so long that I > thought I would post a solution: > > > NB. Input translation to N/SE/SW form > > 'n

Re: [Jprogramming] Strange behavior of 0x1

2017-12-17 Thread Henry Rich
Yes, we have tracked it down.  the x in 0x1 was being interpreted (in the Linux version of strtod) as a valid numeric character. The problem afflicts ONLY numeric constants that begin with 0x, and is therefore rarely encountered. Henry Rich On 12/17/2017 5:15 PM, Don Kelly wrote: The error d

Re: [Jprogramming] Strange behavior of 0x1

2017-12-17 Thread Don Kelly
The error doesn't appear in J806 Windows 10/64 bit /amd a10-7800 Don On 2017-12-16 7:49 PM, bill lam wrote: On j android, it looks like that 0xn is evaluated as nxn 0x1 2.71828 1x1 2.71828 0x2 14.7781 2x2 14.7781 0x3 60.2566 3x3 60.2566 On Dec 17, 2017 12:33 AM, "Henry

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Henry Rich
I haven't been following this thread but has gone on so long that I thought I would post a solution: NB. Input translation to N/SE/SW form 'n s ne se nw sw' =: _3 ,:\ 1 0 0   _1 0 0 0 0 _1  0 1 0   0 _1 0  0 0 1 NB. Apply transformations. We want the one transformtation that converts the mos

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Brian Schott
Raul, Right, I remember now that you said that earlier in this thread. Obviously, I did not understand it then. Thanks for your patience and great help, On Sun, Dec 17, 2017 at 2:06 PM, Raul Miller wrote: > They are locations that are unique. And they can be converted into > either number of s

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Raul Miller
They are locations that are unique. And they can be converted into either number of steps to that location or into a sequence of steps to reach that location: nsteps=: +/@:|"1 path=:3 :0 r=.'' while. 0<+/|y do. pick=. (i. <./) +/"1|dss -~"1/ y y=.y-pick{dss r=.r,pick{nms end. )

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Raul Miller
Oops, sorry, you are right. Here is what I should have sent you: dss=:-:<:3 #.inv 15 21 19 11 5 7 nms=: ;:'n ne se s sw nw' location=:3 :0 +/dss{~nms i.y ) Sorry about that, I should have tested it instead of just editing it based on memory. Bad habits are bad. Thanks, -- Raul On Sun, Dec 1

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Brian Schott
Raul, Maybe I misspoke again. I debugged location and looked at the following result. _3{.+/\dss{~nms i.y 348.5 _242.5 _106 348 _242 _106 348 _241.5 _106.5 Are those locations that you can read and are they unique? -

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Brian Schott
Raul, I see the result of `location` as being the number of steps, but not a grid location (as you suggest) because its result is simply 696 in my data's case, for example. Of course, that's all that AoC 11 required. My approach using Jimmy's algorithm (I think) does perhaps not tell the exact fi

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Raul Miller
Here's how I would interpret the final stage's result: dss=:-:<:3 #.inv 15 21 19 11 5 7 nms=: ;:'n ne se s sw nw' location=:3 :0 {:+/||:+/\dss{~nms i.y ) This translates a symbolic sequence into a grid location. So as a basic integrity check, I would run it against both your source sequence and

Re: [Jprogramming] AoC Day 11 - something is wrong

2017-12-17 Thread Brian Schott
All, not just Raul and Jimmy, I have chosen to reply to this earlier email because it contains the "first attempt" solution I previously posted. That solution ends inconclusively and created too many posts from me. However, those posts and especially Raul's guidance have led to another level of co