Advertisement
mrWhiskasss

Печать таблицы print(table) lua

Nov 23rd, 2021
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function tprint (tbl, indent)
  2. if not indent then indent = 0 end
  3. for k, v in pairs(tbl) do
  4. formatting = string.rep(" ", indent) .. k .. ": "
  5. if type(v) == "table" then
  6. print(formatting)
  7. tprint(v, indent+1)
  8. elseif type(v) == 'boolean' then
  9. print(formatting .. tostring(v))
  10. else
  11. print(formatting .. v)
  12. end
  13. end
  14. end
  15. local component = require("component")
  16. --local cpc1 = component.crystal
  17. --tprint (component.doc("87ef562a-6fc8-4019-a3d8-ffe44a92bab5"), "getItemsInNetwork")
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement