localM={}localcolor={r="\27[1;31m",g="\27[1;32m",y="\27[1;33m",b="\27[1;34m",p="\27[1;35m"}-- type to colorlocalttc={['nil']='r',['boolean']='y',['number']='g',['string']='b',['function']='p'}localcn="\27[0m"--- print the indentlocalfunctionpi(indent)io.write(string.rep(" ",indent))end--- print next linelocalfunctionpl()io.write("\n")end--- print the variablelocalfunctionpv(var,c)ifcandcolor[c]thenio.write(color[c]..tostring(var)..cn)elseio.write(tostring(var))endend--- print the tablelocalfunctionpt(var,indent)pv('{');pl()fork,vinpairs(var)dopi(indent+1);pv('[');pv(k,ttc[type(k)]);pv('] ')localt=type(v)ift=='table'thenpt(v,indent+1)elsepv(v,ttc[t]);pl()endendpi(indent);pv('}');pl()endfunctionM.p(var)localt=type(var)ift=='table'thenpt(var,0)elsepv(var,ttc[t]);pl()endendreturnM