⍝ Cut operator:

    x←4 10⍴⍳40

    (⊂⌽3  4↑1  2↓x)≡(⍉(1 2+⎕io),   ⍪3 ¯4)⊂Cut 0⊢x
1
    (⊂⌽3 ¯4↑1 ¯1↓x)≡(⍉((1+⎕io),¯2),⍪3 ¯4)⊂Cut 0⊢x
1
    (⊂⌽3 4↑x)≡3 ¯4⊂Cut 0⊢x
1
    'TUVWXY'≡(⍪¯2       6)⊢Cut 0⊢⎕A
1
    'YXWVUT'≡(⍪¯2      ¯6)⊢Cut 0⊢⎕A
1
    'BCDEFG'≡(⍪(1+⎕io), 6)⊢Cut 0⊢⎕A
1
    'GFEDCB'≡(⍪(1+⎕io),¯6)⊢Cut 0⊢⎕A
1
    x←5 7 11⍴⍳385

    (⊂Cut 0⊢x)≡(⍉,∘⍪-⍴x)⊂Cut 0⊢x
1
    (' foo' ' upon' ' thee')≡⊂Cut  1⊢' foo upon thee'
1
    ('foo'  'upon'  'thee' )≡⊂Cut ¯1⊢' foo upon thee'
1
     0 1 1 0 1 0 0(+⌿Cut  1≡(↑∘(+⌿¨)⊂Cut  1))7 3⍴⍳21
1
     0 1 1 0 1 0 0(+⌿Cut ¯1≡(↑∘(+⌿¨)⊂Cut ¯1))7 3⍴⍳21
1
    ('foo,' 'upon,' 'thee,')≡⊂Cut  2⊢'foo,upon,thee,'
1
    ('foo'  'upon'  'thee' )≡⊂Cut ¯2⊢'foo,upon,thee,'
1
    1∧.=,{(⌈(1+r-s)÷m)≡≢(⍪m,s)⊂Cut ¯3⍳r←47⊣m s←⍵}¨∘.,⍨+\10⍴1
1
    x←(21+30×⎕io-⍨⍳6)∘.+6×⎕io-⍨⍳3

    x≡2 3(+/,)Cut ¯3⊢7 5⍴⎕io-⍨⍳35
1
    ((x,(24+20×⎕io-⍨⍳6),⍪13+10×⎕io-⍨⍳6)⍪93 96 99 67 34)≡2 3(+/,)Cut 3⊢7 5⍴⎕io-⍨⍳35
1
    x←5 7 11⍴⍳385

    (⊂Cut  3⊢x)≡(⍉1,⍪(⍴⍴x)⍴⌊/⍴x)⊂Cut  3⊢x
1
    (⊂Cut ¯3⊢x)≡(⍉1,⍪(⍴⍴x)⍴⌊/⍴x)⊂Cut ¯3⊢x
1
    p←(1 0 1 0 0)(1 0 1 1 0 0 1)
    q←(0 1 0 0 1)(0 1 1 0 0 1 1)
    x←5 7⍴⍳35
    (p⊂Cut  1⊢x)≡⍉¨↑(⊂(1+⎕io)⊃p)⊂Cut 1¨⍉¨(⎕io⊃p)⊂Cut 1⊢x
1
    (q⊂Cut  2⊢x)≡p⊂Cut 1⊢x
1
    (p⊂Cut ¯1⊢x)≡ 1  1∘↓¨p⊂Cut 1⊢x
1
    (q⊂Cut ¯2⊢x)≡¯1 ¯1∘↓¨q⊂Cut 2⊢x
1
    x←7 8⍴⍳56
    q←⍬(0 0 1 1 0 1 0 0)
    (q⊂Cut 1⊢x)≡1 1 0 1 0 0 ⊂[1+⎕io]0  2↓x
1
    q←⍬(1 0 1 0 0 1 0 0)
    (q⊂Cut 2⊢x)≡1 1 0 1 0 0 ⊂[1+⎕io]0 ¯2↓x
1
⍝    ⎕FX'z←f y' 'z←⎕ml'
⍝    (2⍴¨0 1 2 3)≡{⎕ML←⍵ ⋄ 1 0 0 1 0 f Cut 1⊢'abcde'}¨0 1 2 3
⍝1
⍝∇ Cut

Back to: code

Back to: Workspaces