Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function containsValue (tab, val)
- for index, value in ipairs(tab) do
- if value == val then
- return true
- end
- end
- return false
- end
- function math.clamp(value, low, high)
- return math.min(math.max(value, low), high);
- end
- function string:split(delimiter)
- local result = {};
- local from = 1;
- local delim_from, delim_to = string.find( self, delimiter, from )
- while delim_from do
- table.insert( result, string.sub( self, from , delim_from-1 ) )
- from = delim_to + 1
- delim_from, delim_to = string.find( self, delimiter, from )
- end
- table.insert( result, string.sub( self, from ) )
- return result
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement