Module:MOS in EDO: Difference between revisions

Ganaram inukshuk (talk | contribs)
Better support for size-0 steps
Ganaram inukshuk (talk | contribs)
Support for size-0 steps
Line 177: Line 177:
if i == 1 then
if i == 1 then
if current_step_size == 0 then
if current_step_size == 0 then
current_step_vis = double_border_left
else
current_step_vis = left_border .. string.rep(no_border, current_step_size - 1)
current_step_vis = left_border .. string.rep(no_border, current_step_size - 1)
end
elseif i == #step_pattern then
if current_step_size == 0 then
current_step_vis = double_border_right
else
else
current_step_vis = double_border_left
current_step_vis = single_border .. string.rep(no_border, current_step_size - 1) .. right_border
end
end
else
else
Line 186: Line 192:
elseif step_pattern[i-1] == 0 then
elseif step_pattern[i-1] == 0 then
current_step_vis = string.rep(no_border, current_step_size - 1)
current_step_vis = string.rep(no_border, current_step_size - 1)
else
current_step_vis = single_border .. string.rep(no_border, current_step_size - 1)
current_step_vis = single_border .. string.rep(no_border, current_step_size - 1)
end
end
Line 191: Line 198:
step_visualization = step_visualization .. current_step_vis
step_visualization = step_visualization .. current_step_vis
end
if step_pattern[#step_pattern] == 0 then
step_visualization = step_visualization .. double_border_right
else
step_visualization = step_visualization .. right_border
end
end