Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --------------------------------------------------------------------------------
- -- Helper functions
- -- Create a set where membership can be checked by set_name[potential_member]
- function Set (array)
- local set = {}
- for _, l in ipairs(array) do
- set[l] = true
- end
- return set
- end
- -- Get the length of an array
- function Length(array)
- local count = 0
- for _, l in ipairs(array) do
- count = count + 1
- end
- return count
- end
Advertisement
Add Comment
Please, Sign In to add comment