thank you Marshall and Dan,

Similar but not as nice as both your solutions is the simpler:

> 0 1 1 } <"1 i. 2 3 2


----- Original Message -----
From: Marshall Lochbaum <[email protected]>
To: 'Pascal Jasmin' via Programming <[email protected]>
Cc: 
Sent: Friday, July 11, 2014 10:07:53 PM
Subject: Re: [Jprogramming] speaking of amend...

My first instinct would be
   v =: ({"_1) 1 0 2&|:
although this does not generalize to higher-rank arrays without a little
work. The following adverb also works, but goes through boxes and
consequently is probably a bit inefficient.
   v =: } (&.:(<"1))

Marshall




On Fri, Jul 11, 2014 at 05:56:49PM -0700, 'Pascal Jasmin' via Programming wrote:
> what verb v (or I guess adverb is ok) could I use to get
> 
> 0 1 1 v i. 2 3 2
> 
> 0  1
> 8  9
> 10 11
> 
> 
>     i.2 3 2 
>  0  1 
>  2  3 
>  4  5 
>  6  7 
>  8  9 
> 10 11
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to