Contact: aviboots(AT)netvision.net.il
31,094 questions
40,775 answers
573 users
function average(...) result = 0 local arg = {...} for i, n in ipairs(arg) do result = result + n end return result/#arg end print(average(3, 7, 8, 2, 6, 9)) --[[ run: 5.8333333333333 --]]
function f(...) local arg = {...} for i, n in ipairs(arg) do print(i, n) end end f(43, 67, 98, 12, 46, 90) --[[ run: 1 43 2 67 3 98 4 12 5 46 6 90 --]]