Kip Murray wrote:
>  write an adverb tab so that
>     -tab~ i.4
>  -|0  1  2  3
>  -+----------
>  0|0 _1 _2 _3
>  1|1  0 _1 _2
>  2|2  1  0 _1
>  3|3  2  1  0

Well, if you already have  myst  then it's easy:

     tab  =:  1 : 'myst@:(u table)'

if you're asking for a tacit version, then

     tab  =:  table (myst@:)

If you're asking for full implementations, then:

     tab  =:  1 : ' (< 2 # << 0 _1 ) { ":@:(u table)'

or, tacitly:
 
     tab  =:  table (((< 2 # << 0 _1 ) { ":)@:)

-Dan

PS:  I did note that your results had leading and trailing empty lines.  I
presume this is because your  myst  replaces the undesirable formatting
with spaces, rather than removing it altogether, as my implementations do.
 

If you want that behavior, you can use  (' ' (<a:;0 _1)} ' ' 0 _1}   in
place of  (< 2 # << 0 _1 ) {  in my implementations.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to