Module:MOS degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
Step ratio limit increased to 5
Line 7: Line 7:


-- Helper function
-- Helper function
-- Parses up to 3 step ratios entered as text in a semicolon-delimited string,
-- Parses up to 5 step ratios entered as text in a semicolon-delimited string,
-- where each step ratio is separated with a slash
-- where each step ratio is separated with a slash
-- EG, "2/1; 3/1; 3/2" becomes {{2, 1}, {3, 1}, {3, 2}}
-- EG, "2/1; 3/1; 3/2" becomes {{2, 1}, {3, 1}, {3, 2}}
Line 17: Line 17:
end
end
-- Parse up to 3 step ratios
-- Parse up to 5 step ratios (hardcoded)
local loop_limit = math.min(3, #parsed)
local max_ratios = 5
local loop_limit = math.min(max_ratios, #parsed)
local step_ratios = {}
local step_ratios = {}
for i = 1, loop_limit do
for i = 1, loop_limit do