Skip to content

Instantly share code, notes, and snippets.

@nevill
Created October 8, 2013 13:15
Show Gist options
  • Save nevill/6884471 to your computer and use it in GitHub Desktop.
Save nevill/6884471 to your computer and use it in GitHub Desktop.
获得星座名称
// 输入 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