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 }