Task

Take a   Natural Number   in a given base and return the sum of its digits:

   110         sums to   1
   123410   sums to   10
   fe16       sums to   29
   f0e16     sums to   29


function sumDigits n, base
    local numb
    if base is empty then put 10 into base
    repeat for each char d in n
        add baseConvert(d,base,10) to numb
    end repeat
    return numb
end sumDigits