Module:Uniform map: Difference between revisions
merge changes from dev |
ArrowHead294 (talk | contribs) No edit summary |
||
| Line 5: | Line 5: | ||
-- stylua: ignore | -- stylua: ignore | ||
local warts = { | local warts = { | ||
"a", "b", "c", "d", "e", "f", "g", "h", "i", | |||
"j", "k", "l", "m", "n", "o", "p", "q", "r", | |||
"s", "t", "u", "v", "w", "x", "y", "z" | |||
} | } | ||
| Line 92: | Line 92: | ||
local lb = p.lower_bound(map_table) -- Minimum size for the current map | local lb = p.lower_bound(map_table) -- Minimum size for the current map | ||
local ub = p.upper_bound(map_table) -- Maximum size for the current map | local ub = p.upper_bound(map_table) -- Maximum size for the current map | ||
local row = { "Min. size", "Max. size", "[[Wart notation]]" } | local row = {"Min. size", "Max. size", "[[Wart notation]]"} | ||
for i = 1, #map_table.map do | for i = 1, #map_table.map do | ||
table.insert(row, utils.primes[i]) | table.insert(row, utils.primes[i]) | ||
| Line 98: | Line 98: | ||
table.insert(maptable, row) | table.insert(maptable, row) | ||
while lb < max do | while lb < max do | ||
row = { string.format("%.4f", lb), string.format("%.4f", ub), p.wart(map_table.map) } | row = {string.format("%.4f", lb), string.format("%.4f", ub), p.wart(map_table.map)} | ||
for j = 1, #map_table.map do | for j = 1, #map_table.map do | ||
table.insert(row, map_table.map[j]) | table.insert(row, map_table.map[j]) | ||
| Line 120: | Line 120: | ||
end | end | ||
local luatable = p.make_table(prime, utils.eval_num_arg(min, 11.5), utils.eval_num_arg(max, 12.5)) | local luatable = p.make_table(prime, utils.eval_num_arg(min, 11.5), utils.eval_num_arg(max, 12.5)) | ||
local | local wtable = "{| class=\"wikitable\"\n" | ||
.. "|+ style=\"font-size: 105%; | " | |||
.. string.format("%d-limit [[uniform map]]s between %g and %g", prime, min, max) | |||
for i = 1, 3 do | for i = 1, 3 do | ||
wtable = wtable .. "\n! " .. luatable[1][i] | |||
end | end | ||
wtable = wtable .. "\n! Map" | |||
for i = 2, #luatable do | for i = 2, #luatable do | ||
wtable = wtable .. "\n|-" | |||
for j = 1, 3 do | for j = 1, 3 do | ||
wtable = wtable .. "\n| " .. luatable[i][j] | |||
end | end | ||
local wikimap = "" | local wikimap = "" | ||
| Line 135: | Line 136: | ||
wikimap = wikimap .. " " .. luatable[i][j] | wikimap = wikimap .. " " .. luatable[i][j] | ||
end | end | ||
wtable = wtable .. "\n| " .. frame:expandTemplate({ title = "map", args = { wikimap } }) | |||
end | end | ||
wtable = wtable .. "\n|}" | |||
return | return wtable | ||
end | end | ||
return p | return p | ||