Skip to content

Instantly share code, notes, and snippets.

Created Nov 14, 2020
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
return sum / #t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment