dist←{⎕ML←1                         ⍝ Levenshtein distance.
    a(n+1)(⍴⍺)+n←⍴⍵               ⍝ first row of matrix
    f←⍵{⌊\⍵⌊(⊃⍵),(¯1↓⍵)-1+⍺=⍺⍺}     ⍝ iteration step
    z←⊃f/(⌽⍺),⊂a                    ⍝ last row of matrix
    ⊃⌽z
}

code_colours

test script

Back to: notes

Back to: Workspaces