Here's another suggestion, using the binomial coefficients mod 2.  In J504:

v=:13 : '2 | (i.>:y.)!y.'
line=:13 : '((x.-y.)#'' ''),(": v y.)'"0
triangle=:13 : 'y. line i.y.'
triangle 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

Best wishes,

John


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

Reply via email to