Module:Hore

Ka Wikipedia

Documentation for this module may be created at Module:Hore/doc

--Nuqul ka mid ah tusmooyinka Bogga Hore

local fgetFAlist = require('Module:Hore/Xul').getFAlist
local fgetGAlist = require('Module:Hore/Cusub').getGAlist

local a = {}


function a.rnumber( frame )
    d = {}

    if(frame.args[1] =='ga' or frame.args[1] =='Cusub' ) then
    	d = fgetGAlist()
	elseif (frame.args[1] =='fa' or frame.args[1] =='Xul' ) then
		d = fgetFAlist()
	end
	
    return #d 
end

function a.rlist( frame )
    d = {}
    if(frame.args[1] =='ga' or frame.args[1] =='Cucub' ) then
    	d = fgetGAlist()
	elseif (frame.args[1] =='fa' or frame.args[1] =='Xul' ) then
		d = fgetFAlist()
	end
    
    math.randomseed( os.time() )
    x = math.random(1,#d) 
    repeat
    	x1 = math.random(1,#d)
	until x1 ~= x
    repeat
    	x2 = math.random(1,#d)
	until (x2 ~= x and x2 ~= x1)

    return "[["..d[x1].."]] – [["..d[x].."]] – [["..d[x2].."]]" 
end

function a.plist(frame)
    local c = ''
    local d = {}
    if(frame.args[1] =='ga' or frame.args[1] =='Cusub' ) then
    	d = fgetGAlist()
	elseif (frame.args[1] =='fa' or frame.args[1] =='Xul' ) then
		d = fgetFAlist()
	end
    for _,s in ipairs(d) do
       c = c .. "\n* [[" .. s .. "]]"
    end
  return c 
end

return a