Advertisement
Guest User

Untitled

a guest
Dec 24th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.21 KB | None | 0 0
  1. -- Count the number of times a value occurs in a table
  2. function table_count(tt, item)
  3.   local count
  4.   count = 0
  5.   for ii,xx in pairs(tt) do
  6.     if item == xx then count = count + 1 end
  7.   end
  8.   return count
  9. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement