模块:StarSign:修订间差异

来自TFLS Wiki
无编辑摘要
(已保护“模块:StarSign”([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期))[连锁保护])
 
(未显示同一用户的4个中间版本)
第9行: 第9行:


function p._getStar(args)
function p._getStar(args)
 
args[1] = tonumber(args[1])
if args[1] == 01 then
args[2] = tonumber(args[2])
if args[1] == 1 then
if args[2] <= 19 then
if args[2] <= 19 then
return '摩羯座'
return '摩羯座'
第16行: 第17行:
return '水瓶座'
return '水瓶座'
end
end
elseif args[1] == 02 then
elseif args[1] == 2 then
if args[2] <= 18 then
if args[2] <= 18 then
return '水瓶座'
return '水瓶座'
第22行: 第23行:
return '双鱼座'
return '双鱼座'
end
end
elseif args[1] == 03 then
elseif args[1] == 3 then
if args[2] <= 20 then
if args[2] <= 20 then
return '双鱼座'
return '双鱼座'
第28行: 第29行:
return '白羊座'
return '白羊座'
end
end
elseif args[1] == 04 then
elseif args[1] == 4 then
if args[2] <= 19 then
if args[2] <= 19 then
return '白羊座'
return '白羊座'
第34行: 第35行:
return '金牛座'
return '金牛座'
end
end
elseif args[1] == 05 then
elseif args[1] == 5 then
if args[2] <= 20 then
if args[2] <= 20 then
return '金牛座'
return '金牛座'
第40行: 第41行:
return '双子座'
return '双子座'
end
end
elseif args[1] == 06 then
elseif args[1] == 6 then
if args[2] <= 21 then
if args[2] <= 21 then
return '双子座'
return '双子座'
第46行: 第47行:
return '巨蟹座'
return '巨蟹座'
end
end
elseif args[1] == 07 then
elseif args[1] == 7 then
if args[2] <= 22 then
if args[2] <= 22 then
return '巨蟹座'
return '巨蟹座'
第52行: 第53行:
return '狮子座'
return '狮子座'
end
end
elseif args[1] == 08 then
elseif args[1] == 8 then
if args[2] <= 22 then
if args[2] <= 22 then
return '狮子座'
return '狮子座'
第58行: 第59行:
return '处女座'
return '处女座'
end
end
elseif args[1] == 09 then
elseif args[1] == 9 then
if args[2] <= 22 then
if args[2] <= 22 then
return '处女座'
return '处女座'

2022年5月23日 (一) 19:02的最新版本

可在模块: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)
	args[1] = tonumber(args[1])
	args[2] = tonumber(args[2])
	if args[1] == 1 then
		if args[2] <= 19 then
			return '摩羯座'
		else
			return '水瓶座'
		end
	elseif args[1] == 2 then
		if args[2] <= 18 then
			return '水瓶座'
		else
			return '双鱼座'
		end
	elseif args[1] == 3 then
		if args[2] <= 20 then
			return '双鱼座'
		else
			return '白羊座'
		end
	elseif args[1] == 4 then
		if args[2] <= 19 then
			return '白羊座'
		else
			return '金牛座'
		end
	elseif args[1] == 5 then
		if args[2] <= 20 then
			return '金牛座'
		else
			return '双子座'
		end
	elseif args[1] == 6 then
		if args[2] <= 21 then
			return '双子座'
		else
			return '巨蟹座'
		end
	elseif args[1] == 7 then
		if args[2] <= 22 then
			return '巨蟹座'
		else
			return '狮子座'
		end
	elseif args[1] == 8 then
		if args[2] <= 22 then
			return '狮子座'
		else
			return '处女座'
		end
	elseif args[1] == 9 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


return p