After some thought, I am in favor of this version (I think first
proposed by Henry):

   ((* * <&0) ,. #:) i:3
_1 0 1
_1 1 0
_1 1 1
 0 0 0
 0 0 1
 0 1 0
 0 1 1
   #. ((* * <&0) ,. #:) i:3
_3 _2 _1 0 1 2 3

Note also:
   2 | ((* * >&0) ,. #:) i:3
0 0 1
0 1 0
0 1 1
0 0 0
1 0 1
1 1 0
1 1 1

That said this could be further "improved" by making the #: result
follow the p. result pattern (least significant bit first):

   (|.@#: ,. * * <&0) i:3
1 1 _1
1 0 _1
0 1 _1
0 0  0
1 1  0
1 0  0
0 1  0
   (|.@#: , * * <&0)"0 i:3
1  0 _1
0  1 _1
1 _1  0
0  0  0
1  0  0
0  1  0
1  1  0
   #.@|. :(#. |.)"1 (|.@#: ,. * * <&0) i:3
_1 _3 _2 0 3 1 2
   #.@|. :(#. |.)"1 (|.@#: , * * <&0)"0 i:3
_3 _2 _1 0 1 2 3
   2 p.~ (|.@#: , * * <&0)"0 i:3
_3 _2 _1 0 1 2 3


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

Reply via email to