Module:Sandbox/AngryBiceps
Appearance
local p = {};
p.nahodneFakty = function(frame)
local pocetFaktov = 4
zaciatok = [[<div style="float: right; margin:0.5em 0.5em 0.5em 1.5em; border: 1px solid #c2dfff; padding:1px; margin-bottom:5px; background-color: #f5faff;">]]
local fakty = {
"Text1",
"Text2",
"Text3",
"Text4",
"Text5",
"Text6",
"Text7",
"Text8",}
local faktyObrazok = {
"Text1",
"Text2",
"Text3",
"Text4",
}
local obrazok = {
"[[File:TEPLAREN-lowres-1008.jpg|150px|Jurkovičova Tepláreň]]",
"[[File:TEPLAREN-lowres-1008.jpg|150px|Jurkovičova Tepláreň]]",
"[[File:TEPLAREN-lowres-1008.jpg|150px|Jurkovičova Tepláreň]]",
"[[File:TEPLAREN-lowres-1008.jpg|150px|Jurkovičova Tepláreň]]",}
math.randomseed(os.time())
local vystupFakty = {}
for p = pocetFaktov, 1, -1 do
i=#fakty
local j = math.random(i)
fakty[i], fakty[j] = fakty[j], fakty[i]
table.insert(vystupFakty, fakty[i])
end
return zaciatok, obrazok[1] .. "</div>", dump(vystupFakty)
end
function dump(o)
if type(o) == 'table' then
local s = '<br>'
for k,v in pairs(o) do
s = s .. '<br>' .. (v)
end
return s
else
return tostring(o)
end
end
return p