Definitely more concise. (And, if it helps, it seemed like there ought to have been a more concise approach - the number of steps I had was significantly larger than the number of differences in structure which I felt were represented by the problem. But that's why emailing code is fun.)
Thanks again, -- Raul On Sat, Oct 5, 2013 at 1:07 PM, Henry Rich <[email protected]> wrote: > or > > <@;&{."1&>/ (< _1]\ 0 1 2), (< _1]\ 'a','b','c') > > Henry Rich > > > On 10/5/2013 12:41 PM, Raul Miller wrote: >> >> Here's one approach: >> >> <"1|:><@{."1 L:0 (< _1]\ 0 1 2), (< _1]\ 'a','b','c') >> >> Note that your original form has 2 boxes and the contents of the boxes >> have shape 3 1, while your final form has 3 boxes and the contents of >> those boxes have shape 2. So we have to do something arbitrary to get >> rid of the "1" dimension. >> >> Note also that the intermediate form produced by >> >> <@{."1 L:0 array >> >> could also have been produced by >> >> ]&.>@,&.> array >> >> Thanks, >> > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
