Module:MOS: Difference between revisions

Inthar (talk | contribs)
m Replacing the algorithm in `brightest_mode()` with the "Christoffel word walk" algorithm which is always linear time.
Inthar (talk | contribs)
No edit summary
Line 142: Line 142:
local current_L, current_s = 0, 0
local current_L, current_s = 0, 0
local result = ''
local result = ''
while current_L < a or current_s < b do
while current_L < nL or current_s < ns do
if (current_s + 1) * a <= b * (current_L) then
if (current_s + 1) * nL <= ns * (current_L) then
             current_s = current_s + 1
             current_s = current_s + 1
             result = result .. 's'
             result = result .. 's'