Module:User:NickTheRed37/RandomFact

-- Random facts module

local p = {}

function p.randfact(f) -- Arguments local args = f:getParent.args -- Quotes local quotes = {} -- Initial text local starttext = "" -- Seed the random number generator math.randomseed(os.time) for i, v in ipairs(args) do       if i == 1 then starttext = v           if starttext:sub(-1) == "\n" then starttext = starttext:sub(1, starttext:len-1) end else table.insert(quotes, v)       end end -- Random selector local id = math.random(#quotes) return starttext .. "... ..." .. quotes[id] end

return p