Module:MOS in EDO: Difference between revisions
Added support for size-0 steps to step vis function |
Better support for size-0 steps |
||
| Line 161: | Line 161: | ||
local no_border = "─" | local no_border = "─" | ||
local double_border = "╫" | local double_border = "╫" | ||
local double_border_left = "╟" | |||
local double_border_right = "╢" | |||
local single_border = "┼" | local single_border = "┼" | ||
| Line 167: | Line 169: | ||
-- For each step size of k, print a single border, followed by k-1 no-border symbols | -- For each step size of k, print a single border, followed by k-1 no-border symbols | ||
-- If this is the first step, print the left border instead | -- If this is the first step, print the left border instead | ||
-- If the step size is 0, print a double border only | -- If the step size is 0, print a double border only; if this happens, the next step should start with a border character | ||
-- If this is the last step, add a right border after the entire sequence | -- If this is the last step, add a right border after the entire sequence | ||
for i = 1, #step_pattern do | for i = 1, #step_pattern do | ||
| Line 174: | Line 176: | ||
if i == 1 then | if i == 1 then | ||
current_step_vis = left_border .. string.rep(no_border, current_step_size - 1) | if current_step_size == 0 then | ||
current_step_vis = left_border .. string.rep(no_border, current_step_size - 1) | |||
else | |||
current_step_vis = double_border_left | |||
end | |||
else | else | ||
if current_step_size == 0 then | if current_step_size == 0 then | ||
current_step_vis = double_border | current_step_vis = double_border | ||
elseif step_pattern[i-1] == 0 then | |||
current_step_vis = string.rep(no_border, current_step_size - 1) | |||
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 186: | Line 193: | ||
end | end | ||
step_visualization = step_visualization .. right_border | if step_pattern[#step_pattern] == 0 then | ||
step_visualization = step_visualization .. double_border_right | |||
else | |||
step_visualization = step_visualization .. right_border | |||
end | |||
return step_visualization | return step_visualization | ||