3415
редагувань
Admin (обговорення | внесок) Немає опису редагування |
Admin (обговорення | внесок) Немає опису редагування |
||
(Не показано 6 проміжних версій цього користувача) | |||
Рядок 1: | Рядок 1: | ||
-- This module will handle the shuffling and display of random players. | |||
function p. | local p = {} -- Define a table to hold your module's functions | ||
local | function p.showRandomPlayers(frame) | ||
local | 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 = {} | local output = {} | ||
for i = 1, 4 do | |||
table.insert(output, string.format('<p>[[%s|%s]]</p>', players[i], players[i])) | |||
for i = 1, | |||
table.insert(output, string.format('<p>[[%s|%s]]</p>', | |||
end | end | ||
Рядок 22: | Рядок 30: | ||
end | end | ||
return p | return p -- Return the table to make its functions accessible to other modules |