Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function table_count(tt, item)
- local count
- count = 0
- for ii,xx in pairs(tt) do
- if item == xx then count = count + 1 end
- end
- return count
- end
- function table_unique(tt)
- local newtable = {}
- for ii,xx in ipairs(tt) do
- if table_count(newtable, xx) == 0 then
- newtable[#newtable+1] = xx
- end
- end
- return newtable
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement