Module:MOS in EDO allperiods: Difference between revisions

Ganaram inukshuk (talk | contribs)
Added code to hopefully skip same-size generator pairs
Ganaram inukshuk (talk | contribs)
Fixed code for skipping genpairs that are the same size
Line 38: Line 38:
-- Starting generator
-- Starting generator
-- If the period is perfectly divisible by 2, add 1 to the starting generator
-- If the generator and its complement are the same, skip that genpair by
-- incrementing the starting generator by 1
local starting_generator = math.ceil(period_in_edosteps / verified_number_of_periods / 2)
local starting_generator = math.ceil(period_in_edosteps / verified_number_of_periods / 2)
if period_in_edosteps % 2 == 0 then
local complement = period_in_edosteps - starting_generator
if starting_generator == complement then
starting_generator = starting_generator + 1
starting_generator = starting_generator + 1
end
end