Module:RandomCatholicOnlineContent: Difference between revisions

no edit summary
No edit summary
No edit summary
 
Line 84: Line 84:


function p.getRandomSubpage(frame)
function p.getRandomSubpage(frame)
    local seed = os.time() + (tonumber(frame.args[1]) or 0)
    math.randomseed(seed % 1000000) -- Ensure valid seed range
     local max = #subpages
     local max = #subpages
     local randomIndex = math.random(1, max)
     local randomIndex = math.random(1, max)
Line 89: Line 91:
end
end


-- Debugging function to test randomness
function p.testRandomness(frame)
function p.testRandomness(frame)
     local results = {}
     local results = {}