Module:MOS: Difference between revisions
I was very dumb. |
No edit summary |
||
| Line 4: | Line 4: | ||
local p = {} | local p = {} | ||
p.tamnams_name = { -- Only mosses with 2/1-equave names in TAMNAMS | p.tamnams_name = { -- Only mosses with 2/1-equave names in TAMNAMS | ||
| Line 150: | Line 143: | ||
while current_nL > 1 or current_ns > 1 do -- while current mos is not 1L 1s<equave>, record current mos and go up to parent | while current_nL > 1 or current_ns > 1 do -- while current mos is not 1L 1s<equave>, record current mos and go up to parent | ||
table.insert(path_to_root, {[1] = current_nL, [2] = current_ns}) | table.insert(path_to_root, {[1] = current_nL, [2] = current_ns}) | ||
current_nL, current_ns = math.min(current_nL, current_ns), abs(current_nL - current_ns) -- parent's nL and ns | current_nL, current_ns = math.min(current_nL, current_ns), math.abs(current_nL - current_ns) -- parent's nL and ns | ||
end | end | ||
local len_of_path = table.getn(path_to_root) | local len_of_path = table.getn(path_to_root) | ||
| Line 178: | Line 171: | ||
while current_nL > 1 or current_ns > 1 do -- while current mos is not 1L 1s, record current mos and go up to parent | while current_nL > 1 or current_ns > 1 do -- while current mos is not 1L 1s, record current mos and go up to parent | ||
table.insert(path_to_root, {[1] = current_nL, [2] = current_ns}) | table.insert(path_to_root, {[1] = current_nL, [2] = current_ns}) | ||
current_nL, current_ns = math.min(current_nL, current_ns), abs(current_nL - current_ns) | current_nL, current_ns = math.min(current_nL, current_ns), math.abs(current_nL - current_ns) | ||
end | end | ||
local len_of_path = table.getn(path_to_root) | local len_of_path = table.getn(path_to_root) | ||