That's it!
I wanted a combination of partitioning and indexing, and L: does the job. I'll
have to do some studying to understand L:.

r

9 8 6 1 2 2 2 6 8 7

5 4 8 4 2 7 9 1 4 1

4 3 3 7 7 0 6 7 6 6

m1

┌───────┬─────┬───┬─┐

│0 1 5 3│4 2 8│7 6│9│

└───────┴─────┴───┴─┘

m1 {L:0"1 r

┌───────┬─────┬───┬─┐

│9 8 2 1│2 6 8│6 2│7│

├───────┼─────┼───┼─┤

│5 4 7 4│2 8 4│1 9│1│

├───────┼─────┼───┼─┤

│4 3 0 7│7 3 6│7 6│6│

└───────┴─────┴───┴─┘


On the other hand, if all I want to do is partition arrays, Michael Day's
solution is a handy technique that I will try to remember:


1 0 0 0 1 0 0 1 0 1 <;.1"1 r

┌───────┬─────┬───┬─┐

│9 8 6 1│2 2 2│6 8│7│

├───────┼─────┼───┼─┤

│5 4 8 4│2 7 9│1 4│1│

├───────┼─────┼───┼─┤

│4 3 3 7│7 0 6│7 6│6│

└───────┴─────┴───┴─┘
Skip Cave
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to