Module:Uniform map: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
m +Debugging option
Line 122: Line 122:
local wtable = "{| class=\"wikitable\"\n"
local wtable = "{| class=\"wikitable\"\n"
.. "|+ style=\"font-size: 105%; | "
.. "|+ style=\"font-size: 105%; | "
.. string.format("%d-limit [[uniform map]]s between %g and %g", prime, min, max)
.. string.format("%d-limit [[uniform map]]s between %g and %g\n", prime, min, max)
.. "\n|-\n"
.. "|-\n"
for i = 1, 3 do
for i = 1, 3 do
wtable = wtable .. "\n! " .. luatable[1][i]
wtable = wtable .. "! " .. luatable[1][i] .. "\n"
end
end
wtable = wtable .. "\n! Map"
wtable = wtable .. "! Map\n"
for i = 2, #luatable do
for i = 2, #luatable do
wtable = wtable .. "\n|-"
wtable = wtable .. "|-\n"
for j = 1, 3 do
for j = 1, 3 do
wtable = wtable .. "\n| " .. luatable[i][j]
wtable = wtable .. "| " .. luatable[i][j] .. "\n"
end
end
local wikimap = ""
local wikimap = ""
Line 137: Line 137:
wikimap = wikimap .. " " .. luatable[i][j]
wikimap = wikimap .. " " .. luatable[i][j]
end
end
wtable = wtable .. "\n| " .. frame:expandTemplate({ title = "map", args = { wikimap } })
wtable = wtable .. "| " .. frame:expandTemplate({ title = "map", args = { wikimap } }) .. "\n"
end
end
wtable = wtable .. "\n|}"
wtable = wtable .. "|}"
return wtable
local debugg = frame.args["debug"]
return frame:preprocess(debugg == "true" and "<pre>" .. wtable .. "</pre>" or wtable)
end
end


return p
return p