Posted 11 May 2012 - 08:43 PM
cats = {10,11,12,8,100}
for i,v in ipairs(cats) do
t = #cats
v/t = z
print(?) - -sum of z
end
Basically i want it to print the sum of z, how would i go about getting the sum?
cats = {10,11,12,8,100}
for i,v in ipairs(cats) do
t = #cats
v/t = z
print(?) - -sum of z
end
local cats = {10,11,12,8,100}
local z = 0
local t = #cats
for i, v in ipairs(cats) do
z = z + (v / t)
print(z)
end