nicediv←{           ⍝ ⍵ similar integers with sum ⍺.
    q←⍵⍴⌊⍺÷⍵        ⍝ quotient.
    d←+\(⍵|⍺)÷⍵⍴⍵   ⍝ residue spread in ⍵ decimal steps.
    i←2</0,⌊0.5+d   ⍝ residue spread in ⍵ integer steps.
    q+i
}

code_colours

test script

Back to: notes

Back to: Workspaces