根据生日得到星座

--得到星座
function DataCenter_Setting:GetConstellation(month, day)
    local dataInfo = {121, 220, 321, 421, 522, 622, 723, 824, 924, 1024, 1123, 1222}
    local Constellations = {"水瓶", "双鱼", "白羊", "金牛", "双子", "巨蟹", "狮子", "处女", "天秤", "天蝎", "射手", "摩羯"}

    local birth = 100*month+date; 
    for i=12, 1, -1 do
        if birth > dataInfo[i] then
            return Constellations[i]
        end
    end
    
    return "摩羯"
end

 

posted @ 2016-12-20 16:04  吴筱军  阅读(260)  评论(0编辑  收藏  举报