Module:Scale tree: Difference between revisions

Ganaram inukshuk (talk | contribs)
/ -> :
Ganaram inukshuk (talk | contribs)
Moved step ratio ranges to hardness column, not step ratio column
Line 134: Line 134:
-- Cell for step ratio
-- Cell for step ratio
-- Include appropriate tamnams name for step ratio
local step_ratio_as_text = string.format("%d:%d", step_ratio[1], step_ratio[2])
local step_ratio_as_text = string.format("%d:%d", step_ratio[1], step_ratio[2])
result = result .. string.format("| %s\n", step_ratio_as_text)
-- Cell for hardness, with divide-by-zero check
-- Include appropriate tamnams name for specific step ratios
local hardness = string.format("%.3f", step_ratio[1] / step_ratio[2])
if step_ratio_as_text == "1:1" then
if step_ratio_as_text == "1:1" then
result = result .. string.format("| %s (equalized)\n", step_ratio_as_text)
result = result .. string.format("| %s (equalized)\n", hardness)
elseif step_ratio_as_text == "4:3" then
elseif step_ratio_as_text == "4:3" then
result = result .. string.format("| %s (supersoft)\n", step_ratio_as_text)
result = result .. string.format("| %s (supersoft)\n", hardness)
elseif step_ratio_as_text == "3:2" then
elseif step_ratio_as_text == "3:2" then
result = result .. string.format("| %s (soft)\n", step_ratio_as_text)
result = result .. string.format("| %s (soft)\n", hardness)
elseif step_ratio_as_text == "5:3" then
elseif step_ratio_as_text == "5:3" then
result = result .. string.format("| %s (semisoft)\n", step_ratio_as_text)
result = result .. string.format("| %s (semisoft)\n", hardness)
elseif step_ratio_as_text == "2:1" then
elseif step_ratio_as_text == "2:1" then
result = result .. string.format("| %s (basic)\n", step_ratio_as_text)
result = result .. string.format("| %s (basic)\n", hardness)
elseif step_ratio_as_text == "5:2" then
elseif step_ratio_as_text == "5:2" then
result = result .. string.format("| %s (semihard)\n", step_ratio_as_text)
result = result .. string.format("| %s (semihard)\n", hardness)
elseif step_ratio_as_text == "3:1" then
elseif step_ratio_as_text == "3:1" then
result = result .. string.format("| %s (hard)\n", step_ratio_as_text)
result = result .. string.format("| %s (hard)\n", hardness)
elseif step_ratio_as_text == "4:1" then
elseif step_ratio_as_text == "4:1" then
result = result .. string.format("| %s (superhard)\n", step_ratio_as_text)
result = result .. string.format("| %s (superhard)\n", hardness)
elseif step_ratio_as_text == "1:0" then
elseif step_ratio_as_text == "1:0" then
result = result .. string.format("| %s (collapsed)\n", step_ratio_as_text)
result = result .. string.format("| → ∞ (collapsed)\n", hardness)
else
result = result .. string.format("| %s\n", step_ratio_as_text)
end
-- Cell for hardness, with divide-by-zero check
local hardness = ""
if step_ratio[2] == 0 then
hardness = "→ ∞"
else
else
hardness = string.format("%.3f", step_ratio[1] / step_ratio[2])
result = result .. string.format("| %s\n", hardness)
end
end
result = result .. string.format("| %s\n", hardness)
-- Cell for comment
-- Cell for comment