a) Non-sequentially
b) Without repetitions
c) With all k elements
Then you need an interesting algorithm:
local used_indexes = {}
for i=1, k do
repeat N=random(k)+1
until not used_indexes[N]
used_indexes[N] = 1;
--Actions with the creature with number N (not k!!)
end
_________________
Группа картостроителей
Там ответы на вопросы, руководства, гайды и прочее
Discord-сервер "Герои 5: S.T.A.L.K.E.R"
Сервер по модификации "Герои 5: S.T.A.L.K.E.R"
_________________