Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --~ print a table
- function printTable(list, i)
- local listString = ''
- --~ begin of the list so write the {
- if not i then
- listString = listString .. '{'
- end
- i = i or 1
- local element = list[i]
- --~ it may be the end of the list
- if not element then
- return listString .. '}'
- end
- --~ if the element is a list too call it recursively
- if(type(element) == 'table') then
- listString = listString .. printTable(element)
- else
- listString = listString .. element
- end
- return listString .. ', ' .. printTable(list, i + 1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement