Posted 17 November 2014 - 07:28 AM
Help me to make the counter recurring items.
tE = {'c', 'c', 'c', 'd', 'a', 'b'}
tC = {['a'] = 0, ['b'] = 0, ['c'] = 0, ['d'] = 0}
function counter(tbl)
for zr = 1, #tbl+1 do
tC[tbl[zr]] = 1
end
for o = 1, #tbl+1 do
i=o+1
while i < #tbl+1 do
if tbl[o] == tbl[i] then
-- what to write, to the values in the tC was correct?
end
i=i+1
end
end
end
counter(tE)