⍝ Partitioned reduction:

    ⎕io←1

    2 3 3 2 +pred ⍳10
3 12 21 19

    1 2 1 ×pred 2 3 4⍴⍳24
 1   6  4
 5  42  8
 9 110 12
         
13 210 16
17 342 20
21 506 24

    1 2 1,pred 3 4⍴⍳12
┌─┬─────┬──┐
│1│2 3  │4 │
├─┼─────┼──┤
│5│6 7  │8 │
├─┼─────┼──┤
│9│10 11│12│
└─┴─────┴──┘

Back to: code

Back to: Workspaces