Skip to content

Instantly share code, notes, and snippets.

@ripter
Forked from hashmal/gist:874792
Created December 12, 2012 19:29
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ripter/4270799 to your computer and use it in GitHub Desktop.
Save ripter/4270799 to your computer and use it in GitHub Desktop.
Added check for boolean.
-- Print contents of `tbl`, with indentation.
-- `indent` sets the initial level of indentation.
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)
elseif type(v) == 'boolean' then
print(formatting .. tostring(v))
else
print(formatting .. v)
end
end
end
@jordan-zilch
Copy link

I love you!

@beermotor
Copy link

This was helpful, thanks.

@MattCraftsCode
Copy link

I love you too, baby~

@profess1onal
Copy link

weirdo

@Cuh4
Copy link

Cuh4 commented May 12, 2023

I love you!

@Johneriksson88
Copy link

Thanks alot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment