2023年政策修订增补工作正在进行中,欢迎参与!
Module:Sandbox/Ravenclaw OIer/RandomTouhou
跳转到导航
跳转到搜索
local allTitles = mw.loadData("模块:东方Project:称号(中文)")
local name, titleOfName
local i = 0
name = {}
titleOfName = {}
for k, v in pairs(allTitles) do
name[i] = k
local j = 0
titleOfName[i] = {}
for kk, vv in pairs(v) do
titleOfName[i][j] = vv
j = j + 1
end
i = i + 1
end
return {
["随机"] = function()
math.randomseed(os.time())
local id = 0
repeat id = math.random(#name) until #titleOfName[id] ~= 0
tid = math.random(#titleOfName[id])
return string.format("<span style=\"font-size:60px\">'''%s ----- %s'''</span>",name[id], titleOfName[id][tid])
end
}