|
|
| Zeile 1: |
Zeile 1: |
| local p = {} | | local p = {} |
| --local c = require( "Module:Common" )
| | local c = require( "Module:Common" ) |
| | |
| function tableToString(tbl, indent)
| |
| indent = indent or 0
| |
| local toprint = string.rep(" ", indent) .. "{\n"
| |
| indent = indent + 2
| |
| for k, v in pairs(tbl) do
| |
| toprint = toprint .. string.rep(" ", indent)
| |
| if type(k) == "number" then
| |
| toprint = toprint .. "[" .. k .. "] = "
| |
| elseif type(k) == "string" then
| |
| toprint = toprint .. k .. " = "
| |
| end
| |
| if type(v) == "number" then
| |
| toprint = toprint .. v .. ",\n"
| |
| elseif type(v) == "string" then
| |
| toprint = toprint .. "\"" .. v .. "\",\n"
| |
| elseif type(v) == "table" then
| |
| toprint = toprint .. tableToString(v, indent + 2) .. ",\n"
| |
| else
| |
| toprint = toprint .. "\"" .. tostring(v) .. "\",\n"
| |
| end
| |
| end
| |
| toprint = toprint .. string.rep(" ", indent - 2) .. "}"
| |
| return toprint
| |
| end
| |
|
| |
|
| function p.Versuch(frame) | | function p.Versuch(frame) |