Модуль:RandomMembers
Документацію для цього модуля можна створити у Модуль:RandomMembers/документація
-- This module will handle the shuffling and display of random players.
local p = {} -- Define a table to hold your module's functions
function p.showRandomPlayers(frame)
math.randomseed(os.time()) -- Seed the random number generator
-- List of players
local players = {
"Індиго", "Адамант", "Алоха", "Аріель", "Берлін", "Бетмен", "Браун", "ВВ",
"Дантес", "Демон", "Джордж", "Доктор Хаус", "Доктор Ямато", "Емесай", "ЕХС", "Кексік",
"Керміт", "Клайд", "Клей", "Комар", "Лемур", "Містер Тен", "Малена", "Мальвінка",
"Маска", "Мері", "Механік", "Ніколетта", "Оттерія", "Расм", "Сімон", "Справа",
"Тайєр", "Тян", "Фавер", "Фаза", "Фейт", "Хантер", "Хоррорчік", "Шостік"
}
-- Shuffle players
for i = #players, 2, -1 do
local j = math.random(i)
players[i], players[j] = players[j], players[i]
end
-- Collect the first four players
local output = {}
for i = 1, 4 do
table.insert(output, string.format('<p>[[%s|%s]]</p>', players[i], players[i]))
end
return table.concat(output, "\n")
end
return p -- Return the table to make its functions accessible to other modules