Re: [Jprogramming] advent 8

2015-12-11 Thread Ryan Eckbo
Much better than the one I came up with. I found removing the parentheses around (_0.1) made it even clearer. On 11 Dec 2015, at 2:55, Joe Bogner wrote: On Thu, Dec 10, 2015 at 3:52 AM, Ryan Eckbo wrote: Also someone could probably write a clever verb to generate the table. I don't know

Re: [Jprogramming] advent 8

2015-12-11 Thread Ryan Eckbo
Very nice, thank you for the improvements. I realised I don't need state 0 for this particular problem, but the '1+' solution is good to know. I'm also going to remember the '[X]' trick (crazy!). On 11 Dec 2015, at 2:19, Raul Miller wrote: I would be tempted to express your S like this: SM=

Re: [Jprogramming] advent 8

2015-12-10 Thread Joe Bogner
> On Thu, Dec 10, 2015 at 3:52 AM, Ryan Eckbo wrote: Also someone could probably write a clever verb to generate the table. >> I don't know if it's clever, but here's one that matches Raul's input matrix (|@((_0.1)&+)@{. , ] ) |: (10 10 $ _0.2,(10 # 0)) + (i.10) +/ (10 # 0.2) 0.1 1.1 2.1 3.1 4

Re: [Jprogramming] advent 8

2015-12-10 Thread Raul Miller
I would be tempted to express your S like this: SM=: 0 10#: 10* 1+ ".;._2 noun define 0.1 1.1 2.1 3.1 4.1 5.1 6.1 7.1 8.1 9.1NB. initial 0.0 1.2 2.2 3.2 4.2 5.2 6.2 7.2 8.2 9.2NB. 0 0.2 1.0 2.2 3.2 4.2 5.2 6.2 7.2 8.2 9.2NB. 1 0.2 1.2 2.

[Jprogramming] advent 8

2015-12-10 Thread Ryan Eckbo
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 unavoidable? Also someone could probably write a clever verb to generate the table. NB. state machin