Module:Uniform map: Difference between revisions

ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 139: Line 139:


local luatable = p.make_table(prime, min, max)
local luatable = p.make_table(prime, min, max)
local wtable = '{| class="wikitable"\n'
local result = '{| class="wikitable"\n'
.. '|+ style="font-size: 105%; | '
.. '|+ style="font-size: 105%; | '
.. string.format("%d-limit [[uniform map]]s between %g and %g\n", prime, min, max)
.. string.format("%d-limit [[uniform map]]s between %g and %g\n", prime, min, max)
.. "|-\n"
.. "|-\n"
for i = 1, 3 do
for i = 1, 3 do
wtable = wtable .. "! " .. luatable[1][i] .. "\n"
result = result .. "! " .. luatable[1][i] .. "\n"
end
end
wtable = wtable .. "! Map\n"
result = result .. "! Map\n"
for i = 2, #luatable do
for i = 2, #luatable do
wtable = wtable .. "|-\n"
result = result .. "|-\n"
for j = 1, 3 do
for j = 1, 3 do
wtable = wtable .. "| " .. luatable[i][j] .. "\n"
result = result .. "| " .. luatable[i][j] .. "\n"
end
end
local wikimap = ""
local wikimap = ""
Line 156: Line 156:
wikimap = wikimap .. " " .. luatable[i][j]
wikimap = wikimap .. " " .. luatable[i][j]
end
end
wtable = wtable .. string.format("| {{map|%s}}\n", wikimap)
result = result .. string.format("| {{map|%s}}\n", wikimap)
end
end
wtable = wtable .. "|}"
result = result .. "|}"


return frame:preprocess(debugg == true and "<syntaxhighlight lang=\"wikitext\">" .. wtable .. "</syntaxhighlight>" or wtable)
-- Debugger option
if debugg == true then
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>"
end
return frame:preprocess(result)
end
end


return p
return p