请输入您要查询的百科知识:

 

词条 Module:Leapyear
释义

local getArgs = require('Module:Arguments').getArgs

local p = {}

local function leap_year ()

local leapyear

if (0 == (year%4) and (0 ~= (year%100) or 0 == (year%400))) then -- if leapyear then

leapyear = 'yes' -- leapyear = yes

end

end

function p.main(frame)

local args = getArgs(frame)

return p._main(args)

end

function p._main(args)

if leapyear == 'yes' then -- if leapyear then

if args[1] then -- if args[1] is defined then

if args[1] == 'blank' then -- if args[1] is blank then

return -- return (blank)

else

return args[1] -- if args[1] isn't blank then return args[1]

end

else

return 1 -- if args[1] isn't defined return 1

end

else -- if not leapyear then

if args[2] then -- if args[2] is defined then

if args[2] == 'blank' then -- if args[2] is blank

return -- return (blank)

else

return args[2] -- if args[2] isn't blank then return args[2]

end

else

return 0 -- if args[2] isn't defined return 0

end

end

end

return p -- displays result

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/27 10:23:31