Or:
(+|:)-:0,3 0,4 3,:5 4 3 0
?
This generalises the lean but ad hoc expression:
-:@(+|:)@:(|.@(,\.))@:({. 3+i.@-@<: ) 5. NB. eg for 5 x 5
0 1.5 2 2.5 3
1.5 0 1.5 2 2.5
2 1.5 0 1.5 2
2.5 2 1.5 0 1.5
3 2.5 2 1.5 0
... the 3+ bit could be generalised with a bit more work...
Mike
Sent from my iPad
> On 23 Oct 2019, at 04:38, 'Jim Russell' via Programming
> <[email protected]> wrote:
>
> D=: (+|:)>'';1.5;2 1.5;2.5 2 1.5 0
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm