Created
October 8, 2013 13:15
-
-
Save nevill/6884471 to your computer and use it in GitHub Desktop.
获得星座名称
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 输入 m: 月, d: 天 | |
// 例如 getAstro(5, 1) 返回 `金牛` | |
function getAstro(m, d) { | |
return "魔羯水瓶双鱼牡羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯".substr(m * 2 - (d < "102123444543".charAt(m - 1) - -19) * 2, 2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment