Is this what you are looking for? p=:4 3$;:'p0 p0 p0 p1 p1 p1 p0 p1 p0 p1 p0 p0' s=: ;:'s0 s1 s2 s3' t=: ;:'t0 t1 t2'
left=: [: , ["0/ rght=: [: , ]"0/ splayleft=:2 :0 L=: m left n R=: m rght n D=: R <@,"0&/:&(L&/:) y L D} a:$~,~#y ) splayrght=:2 :0 L=: m left n R=: m rght n D=: L <@,"0&/:&(R&/:) y R D} a:$~,~#y ) example use: s splayleft t ,p s splayrght t ,p That's not exactly what you have, but the way you have it seems more complicated, to me. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
