Module:Step vis: Difference between revisions

ArrowHead294 (talk | contribs)
m Note down Unicode code points and HTML entities
ArrowHead294 (talk | contribs)
mNo edit summary
Line 17: Line 17:
local step_visualization = ""
local step_visualization = ""
local previous_step_size = 0
-- 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
Line 41: Line 42:
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
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
else
Line 48: Line 49:
end
end
step_visualization = step_visualization .. current_step_vis
if not (current_step_size == 0 and previous_step_size == 0) then
step_visualization = step_visualization .. current_step_vis
end
previous_step_size = current_step_size
end
end
return step_visualization
return step_visualization
end
end