模块:StarSign:修订间差异

来自TFLS Wiki
无编辑摘要
无编辑摘要
第9行: 第9行:


function p._getStar(args)
function p._getStar(args)
 
    return args[1]..args[2]
if args[1] == 01 then
if args[2] <= 19 then
return '摩羯座'
else
return '水瓶座'
end
elseif args[1] == 02 then
if args[2] <= 18 then
return '水瓶座'
else
return '双鱼座'
end
elseif args[1] == 03 then
if args[2] <= 20 then
return '双鱼座'
else
return '白羊座'
end
elseif args[1] == 04 then
if args[2] <= 19 then
return '白羊座'
else
return '金牛座'
end
elseif args[1] == 05 then
if args[2] <= 20 then
return '金牛座'
else
return '双子座'
end
elseif args[1] == 06 then
if args[2] <= 21 then
return '双子座'
else
return '巨蟹座'
end
elseif args[1] == 07 then
if args[2] <= 22 then
return '巨蟹座'
else
return '狮子座'
end
elseif args[1] == 08 then
if args[2] <= 22 then
return '狮子座'
else
return '处女座'
end
elseif args[1] == 09 then
if args[2] <= 22 then
return '处女座'
else
return '天秤座'
end
elseif args[1] == 10 then
if args[2] <= 23 then
return '天秤座'
else
return '天蝎座'
end
elseif args[1] == 11 then
if args[2] <= 22 then
return '天蝎座'
else
return '射手座'
end
elseif args[1] == 12 then
if args[2] <= 21 then
return '射手座'
else
return '摩羯座'
end
else
return '错误!无法计算星座'
end
end
end




return p
return p

2022年5月23日 (一) 18:56的版本

可在模块:StarSign/doc创建此模块的帮助文档

local p = {}

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

function p.getStar(frame)
	local args = getArgs(frame)
	return p._getStar(args)
end

function p._getStar(args)
    return args[1]..args[2]
end


return p