Skip to content

Instantly share code, notes, and snippets.

@spirytus
Created July 2, 2014 07:49
Show Gist options
  • Save spirytus/9a580b35e0a57b7bca67 to your computer and use it in GitHub Desktop.
Save spirytus/9a580b35e0a57b7bca67 to your computer and use it in GitHub Desktop.
function tprint (tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else
print(formatting .. v)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment