Module:MOS mode degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
Experimental code for showing both closest modes (brightest-closest and darkest-closest)
Line 77: Line 77:
else
else
-- Modmos udps require a mosabbrev; this is forced to be "m" since some
-- Modmos udps require a mosabbrev; this is forced to be "m" since some
-- abbrevs are tooo long.
-- abbrevs are tooo long. Get both the names for the closest-bright and
-- closest-dark mode. If they're the same, only one name will be used;
-- if not, both are used.
-- The CPOs of a modmos are simply 1 to n (n is the mode count).
-- The CPOs of a modmos are simply 1 to n (n is the mode count).
udps = tamnams.mode_rotation_udps(step_pattern, input_mos, "m")
local udps_closest_bright = tamnams.mode_rotation_udps(step_pattern, input_mos, "m", true)
for i = 1, #udps do
local udps_closest_dark = tamnams.mode_rotation_udps(step_pattern, input_mos, "m", false)
for i = 1, #udps_closest_bright do
if udps_closest_bright[i] == udps_closest_dark[i] then
table.insert(udps, udps_closest_bright[i])
else
table.insert(udps, string.format("%s<br>%s", udps_closest_bright[i], udps_closest_dark[i]))
end
table.insert(cpos, i)
table.insert(cpos, i)
end
end