I’m building a level creator which lets me quickly design a level and test it. It’s working great!
Levels are stored as tables (grid based game) so I’m trying to use pprint(table) to print the table. But the problem is, each line of pprint shows the K as well as the v.
127 = 0,
Is there anyway to get pprint to ONLY print the V? Or to remove the Ks from the table? thanks.
You could make your own custom pprint function!
This mostly keeps the general formatting of the pprint output:
function ppprint(tab)
if type(tab) == "table" then
local str = "{"..tostring(tab).."\n"
for key, val in pairs(tab) do
str = str.." "..val..",\n"
end
str = str.."}"
print(str)
else
print(tab)
end
end