Mercurial > rinkhals
changeset 592:441077fab928
Easter egg.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 28 Nov 2009 23:37:10 +0000 |
parents | 066b85a7f1cf |
children | 967e351872ed |
files | gamelib/eegg.py gamelib/equipment.py gamelib/icons.py |
diffstat | 3 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gamelib/eegg.py Sat Nov 28 23:37:10 2009 +0000 @@ -0,0 +1,17 @@ +import datetime + +def calc_eggday(y): + g = y % 19 + e = 0 + c = y/100 + h = (c-c/4-(8*c+13)/25+19*g+15)%30 + i = h-(h/28)*(1-(h/28)*(29/(h+1))*((21-g)/11)) + j = (y+y/4+i+2-c+c/4)%7 + p = i-j+e + d = 1+(p+27+(p+6)/40)%31 + m = 3+(p+26)/30 + return datetime.date(y,m,d) + +def is_eggday(): + today = datetime.date.today() + return today == calc_eggday(today.year)