triangle =:  (1&(,~ ~:/\^:_1)&(i. 0))@:<
           dtz      =:  (#~ +./\.@:~:&0)
           fmtTrng  =:  >@:((i.&.-@:[ |.&.> ({.&.>~ +:)~) 
<@:":@:dtz"1@:triangle)&.(>: :. }.)
           fmtTrng 10
                 1            
                1 1           
               1 0 1          
              1 1 1 1         
             1 0 0 0 1        
            1 1 0 0 1 1       
           1 0 1 0 1 0 1      
          1 1 1 1 1 1 1 1     
         1 0 0 0 0 0 0 0 1    
        1 1 0 0 0 0 0 0 1 1   
           

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

Reply via email to