--وحدة

local fgetMissingGender = require('وحدة:ملعب/FShbib/بدون جنس').getMissingGender
local a = {}

function a.rnumber( frame )
    d = {}
    if(frame.args[1] =='MG' or frame.args[1] =='بدون جنس' ) then
    	d = fgetMissingGender()
	end
	
    return #d 
end

function a.rlist( frame )
    d = {}
    if(frame.args[1] =='MG' or frame.args[1] =='بدون جنس' ) then
    	d = fgetMissingGender()
	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] =='MG' or frame.args[1] =='دون جنس' ) then
    	d = fgetMissingGender()
	end
    for _,s in ipairs(d) do
       c = c .. "\n* [[" .. s .. "]]"
    end
  return c 
end

return a