Skip to content

Instantly share code, notes, and snippets.

@atirut-w
Created Nov 14, 2020
Embed
What would you like to do?
function math.average(t)
local sum = 0
for _,v in pairs(t) do -- Get the sum of all numbers in t
sum = sum + v
end
return sum / #t
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment