首页
随机
登录
设置
关于NeuroWiki
免责声明
NeuroWiki
搜索
查看“Module:RandomText”的源代码
←
Module:RandomText
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
-- Module:RandomText local p = {} -- Function to randomly select one of the provided arguments function p.choose(frame) -- Get all the arguments passed to the template local args = frame.args -- Collect all non-nil, non-empty arguments local options = {} for _, value in ipairs(args) do if value and value ~= "" then table.insert(options, value) end end -- If there are no valid arguments, return empty if #options == 0 then return "" end -- Randomly choose one of the options math.randomseed(os.time()) -- Seed the random number generator local choice = math.random(1, #options) return options[choice] end return p
该页面使用的模板:
Module:RandomText/doc
(
查看源代码
)
返回
Module:RandomText
。