diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-04-16 10:59:01 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-04-16 10:59:01 +0800 |
commit | 48049f58fca08253facdfa66371b48ea046abcc9 (patch) | |
tree | ae91c8ca340b4ccfdf355291472ca97fd74d7f73 /mbbsd/calendar.c | |
parent | 54ab3b0886feb9faa8ead846c2bd1e2b688023e5 (diff) | |
download | pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.gz pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.bz2 pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.lz pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.xz pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.tar.zst pttbbs-48049f58fca08253facdfa66371b48ea046abcc9.zip |
horoscope flavor birthday card
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3503 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/calendar.c')
-rw-r--r-- | mbbsd/calendar.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mbbsd/calendar.c b/mbbsd/calendar.c index ba0fb45a..2f2e5af6 100644 --- a/mbbsd/calendar.c +++ b/mbbsd/calendar.c @@ -323,3 +323,19 @@ calendar(void) pressanykey(); return 0; } + +int getHoroscope(int m, int d) +{ + // 摩羯 水瓶 雙魚 白羊 金牛 雙子 巨蟹 獅子 處女 天秤 天蠍 射手 + const int firstday[12] = { + /* Dec. */ 22, /* Jan. */ 20, 19, 21, 20, 21, 21, 23, 23, 23, 23, 22 + }; + if (d >= firstday[m]) { + if (m == 12) + return 1; + else + return m - 1; + } + else + return m; +} |