OddMatrix←{ ⎕IO←0 OM←{ (row col locations)←⍵ ⎕VGET'row' 'col' 'locations' mat←row col⍴0 ⊃{(r c)←⍺ ⋄ 1+@c⍤1⊢1+@r⊢⍵}/locations,⊂mat } OM ⍵ ⍝ Tests Assert←{⍺←'Assertion failure' ⋄ 0∊⍵:⍺ ⎕SIGNAL 8 ⋄ shy←0} _←Assert [1 3 1 1 3 1] ≡ OM(row:2 ⋄ col:3 ⋄ locations:(0 1 ⋄ 1 1)) _←Assert [2 2 2 2] ≡ OM(row:2 ⋄ col:2 ⋄ locations:(1 1 ⋄ 0 0)) _←Assert [2 2 2 2 2 2 2 2 2] ≡ OM(row:3 ⋄ col:3 ⋄ locations:(0 0 ⋄ 1 2 ⋄ 2 1)) _←Assert [ ⋄ 2 2 3 2 3] ≡ OM(row:1 ⋄ col:5 ⋄ locations:(0 2 ⋄ 0 4)) _←Assert [3 3 3 3 3 3 3 3] ≡ OM(row:4 ⋄ col:2 ⋄ locations:(1 0 ⋄ 3 1 ⋄ 2 0 ⋄ 0 1)) 'All tests passed.' }