Module:DYK: Difference between revisions

No edit summary
mNo edit summary
 
Line 13: Line 13:
while #ret < tonumber(frame.args[1]) do
while #ret < tonumber(frame.args[1]) do
local my_fact = facts[mrandom(1, facts_len)]
local my_fact = sformat("*...that %s?", facts[mrandom(1, facts_len)])
local do_insert = true
local do_insert = true
for i, v in ipairs(ret) do
for i, v in ipairs(ret) do
mw.log(v)
mw.log(my_fact)
if v == my_fact then
if v == my_fact then
do_insert = false
do_insert = false
Line 24: Line 26:
if do_insert then
if do_insert then
tinsert(ret, sformat("*...that %s?", my_fact))
tinsert(ret, my_fact)
end
end
end
end