Tutorial by Examples

There's no built in way to search a list for a particular item. However Programming in Lua shows how you might build a set that can help: function Set (list) local set = {} for _, l in ipairs(list) do set[l] = true end return set end Then you can put your list in the Set and test for m...
Create a set local set = {} -- empty set Create a set with elements by setting their value to true: local set = {pear=true, plum=true} -- or initialize by adding the value of a variable: local fruit = 'orange' local other_set = {[fruit] = true} -- adds 'orange' Add a member to the ...

Page 1 of 1