On Tue, Jul 10, 2012 at 10:16 AM, Rudi Mann <r...@happyplating.eu> wrote:
> ]original=. 3 4$'ABCDEFGHIJKL'
> ABCD
> EFGH
> IJKL
>
> diag original
>    A
>   BE
> CFI
> DGJ
>   HK
>    L

As Henry points out, verb/. gets diagonals and hands them off to your verb.

However, ]/. original has the wrong orientation.

So to resolve that, use |./. original and then reverse each row in the result:

diag=:3 :0
  |."1 |./. y
)

or

diag=: [: |."1 |./.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to