currently only wren has randomization of clock sequence
need to be done for all birds
function generate_random_sequence() local sequence = {wren_1, wren_2, wren_3, wren_4} for i = 1, #sequence do -- loop throught the elements local random_index = math.random(i) -- picks a random number sequence[i], sequence[random_index] = sequence[random_index], sequence[i] -- swaping the current element with random positions end return sequence -- give us the sequense end
currently only wren has randomization of clock sequence
function generate_random_sequence() local sequence = {wren_1, wren_2, wren_3, wren_4} for i = 1, #sequence do -- loop throught the elements local random_index = math.random(i) -- picks a random number sequence[i], sequence[random_index] = sequence[random_index], sequence[i] -- swaping the current element with random positions end return sequence -- give us the sequense end