Re: [Jprogramming] advent 10

2015-12-12 Thread Brian Schott
Oh? Different inputs for different users. That would explain it. And it renews my confidence in your usual accuracy, too. Thanks, On Sat, Dec 12, 2015 at 10:05 PM, Henry Rich wrote: > No typo by me; I suspect that users get different inputs. > > Henry Rich > -- > (B=) --

Re: [Jprogramming] advent 10

2015-12-12 Thread Henry Rich
No typo by me; I suspect that users get different inputs. Henry Rich On 12/12/2015 8:57 PM, Brian Schott wrote: My attempt fails with a stack error after about power of 25, so I cannot use it to solve day 10, really. The code below can be used as follows, but 40 cannot replace 25. I tried M. b

Re: [Jprogramming] advent 10

2015-12-12 Thread 'Pascal Jasmin' via Programming
192 crashes for me at v^:24. the string gets very long, and you are calling $:@tail 100k times+ on the list at around 20 iterations. The combination with $: is deadly. From: Brian Schott To: Programming forum Sent: Saturday, December 12, 2015 8:57 PM Subject:

Re: [Jprogramming] advent 10

2015-12-12 Thread Brian Schott
My attempt fails with a stack error after about power of 25, so I cannot use it to solve day 10, really. The code below can be used as follows, but 40 cannot replace 25. I tried M. but with no effect. Any other recommendations would be appreciated. NB. v ^: (25) 3 1 1 3 3 2 2 1 1 3 Notice that I

Re: [Jprogramming] advent 10

2015-12-10 Thread Henry Rich
age - From: Joe Bogner To: programm...@jsoftware.com Sent: Thursday, December 10, 2015 9:40 AM Subject: Re: [Jprogramming] advent 10 Thanks, the fill is needed otherwise it would return the wrong result if the last number is the same as the first. I don't think my version is susceptible to t

Re: [Jprogramming] advent 10

2015-12-10 Thread 'Pascal Jasmin' via Programming
I did not know fill on |. worked that way. I see it now. neat. - Original Message - From: Joe Bogner To: programm...@jsoftware.com Sent: Thursday, December 10, 2015 9:40 AM Subject: Re: [Jprogramming] advent 10 Thanks, the fill is needed otherwise it would return the wrong result

Re: [Jprogramming] advent 10

2015-12-10 Thread Joe Bogner
( ((# , {. );. 1)~ 1 , 2 ~:/\ ])^:(40) 1 1 1 3 2 2 2 1 1 3 > > > > - Original Message - > From: Joe Bogner > To: programm...@jsoftware.com > Sent: Thursday, December 10, 2015 8:47 AM > Subject: Re: [Jprogramming] advent 10 > > Clever use of the state machine. I enjoy

Re: [Jprogramming] advent 10

2015-12-10 Thread 'Pascal Jasmin' via Programming
7 AM Subject: Re: [Jprogramming] advent 10 Clever use of the state machine. I enjoy seeing those... Here's mine: NB. part 1 # (,@((#,{.);.1~ _1&(|.!._) ~: ]))^:40 input=:(1 1 1 3 2 2 2 1 1 3) 252594 NB. part 2 # (,@((#,{.);.1~ _1&(|.!._) ~: ]))^:50 input=:(1 1 1 3 2 2 2 1 1 3) 3579328

Re: [Jprogramming] advent 10

2015-12-10 Thread Joe Bogner
Clever use of the state machine. I enjoy seeing those... Here's mine: NB. part 1 # (,@((#,{.);.1~ _1&(|.!._) ~: ]))^:40 input=:(1 1 1 3 2 2 2 1 1 3) 252594 NB. part 2 # (,@((#,{.);.1~ _1&(|.!._) ~: ]))^:50 input=:(1 1 1 3 2 2 2 1 1 3) 3579328 To explain, we are going to use cut to split the

[Jprogramming] advent 10

2015-12-10 Thread Ryan Eckbo
Oops, typo in the title - this is for day 10, not 8. On 10 Dec 2015, at 19:52, Ryan Eckbo wrote: A previous advent answer got me thinking about state machines, so I wrote one for this problem. The extra initial state ruins the natural mapping between states and numbers, but I think it's unav