C语言万年历设计制作
编制万年历的要素:农历公历对照,显示星期,农历干支年,当年生肖,国定节假日,寒天九九,暑日三伏,入梅出梅,节气时间,生辰八字等。
二种显示方式:一种是日历当天或所选日显示(生辰八字查询),另一种是类似台历的月历显示。
农历算法采用数据数组方法,200年日历数据量不大。程序启动时读入即可。
数据结构18位,如daList[2000]=“110010010110000205”; 前12位表示正月到腊月大小月,1为农历大月30天,0为小月29天。 第13,14位表示农历闰月,13位为农历闰月大小,14位为闰几
后4位表示农历年首个朔日,即俗称的正月初一的公历日期,2月5日。
节气交节时刻计算,天文算法很精准,但太复杂,数据数组方法数据量太大,都不合适。如要求精确时间,可用数据数组方法。本程序采用曾次亮先生的算法,算法简单,但精度差些。
台历式显示月历是公历和农历格式化打印,7天一星期打印输出。农历显示包括初一改为那个月,是节气日期改为节气名称,法定节假日显示。节假日既然是国家法定的,那就应从1949年开始显示。其实各节日哪时开始要考证,故且从权统一从1949年开始。此前也就只显示传统节日。
月历和按天日历都显示当月节气中气时间,同时显示指定查询日生辰八字。
生辰八字显示年月日六字加另列出的时辰二字。
另外还显示日八字的五行二十八宿十二建的排列字,如:甲寅 大溪水胃满 。
八字都有显示五行纳音,如:甲子 海中金 。
八字年柱月柱算法有二种,此程序采用较通用的,即年柱以立春日启算,月柱以月首节气日启算。
这里有五行纳音,二十八宿,十二建的算法。程序中有注释供同好参考。
生辰八字查询显示是日的各项信息,另加寒日九九,暑日三伏,入梅出梅信息。
本万年历适应用范围(1900-2100),用图形方法绘出,可加贴底图,可屏幕截图保存图片,共享图片,添加图片输出和打印输出功能。贴图的图片起个文件名放在手机根目录就会自动更换。若要编制年份跨期长的万年历,可向我索取数据资料。我有(B.C.850-3000)的daList(3000)阴历数据。另外还有精确的节气时间数据 jqdata ( 3000 ) 。
下面的代码是用简单的C语言写的,很简洁 ,适用于初学者。
// myspringc v2.7 可编译安卓本机 app 应用
// 此样例可复制黏贴到 myspringc 编译
// 亦可用vb6, VC , Java 等改写
//****************************************
//**** 万年历 (1900-2100) ver. 1.5.2
//**** 简单的C语言 myspringc v2.7 编译调试
//**** 张纯叔 ([email protected])
//****************************************
Canvas cs;
string sBarDes[10];
int nBarId[10];
float src[4]; //ClearDraw (cls) clear screen
int dy,dm,dd;
int wd; //weekday
int alln,alln1; //计算总天数
int i,k,ns,leap;
double nleap,nleapd; //农历闰月,0无闰,闰月大小
int n,n0,n1;
string s,s0,ss,s5;
string s1,s2,s3,s4; // 临时字串
string wds,wdss; //weekday
float x0,y0,x1,y1;
float sx,sy; //用于绘制花纹
string daList[2200]; // 农历数据
double dy0,dy1,dm1,dd1;
string dy2,dm2,dd2; //年月日计算显示
double hh1,mm1,ss1;
string hh2,mm2,ss2; //时分秒计算显示
double jn; //jnum 节气序号
string jname1,jname2;
string jqnames;
string jz60s;
double jd;
double juD,tht,yrD;
double sD; //shouD 节气计算
double vs,dalt;
string das0,das1,das2; // 0 last yy, 1 this yy, 2 new
double ysm,ysd; //年首月,年首日
int msd[12]; //月朔日
int msd0,msd1;
string nlms,nlds; //农历月 , 农 历 日 ,农历日 ,农历日
string getms,getds; //for print nlm , n l d d ,nldd ,nldd
string gms0,gms1;
string gzs,ggzs; //干支$
int gzn;
string sxs,gsxs; //生肖
int sxn;
int jqdn,jqd1,jqd2; //print solar day ( calendar )
string jqs1,jqs2;
string jqss1,jqss2;
string bds;
int gzy,gzm,gzd,gzh; //干支 yy mm dd hh
string gzys,gzms,gzds,gzhs; //八字干支$
int gzn1;
int yz,mz; //年柱 月柱 计算
string bzs; //八字$
string whss,g12ss,st28ss; //五行$十二建 二 十 八 宿 二十八宿 二十八宿
int dzd0,dzd1; //冬至日,计算起九
int fmn,mn,fn; //母亲节父亲节
int isdraw; // bool绘出显示
int setc; //set day color in red
//程序中 // print … 是调试时查看数据计算
main(){
setTitle (“万年历 (1900-2100)”);
jqnames=“小寒大寒立春雨水惊蛰春分清明谷雨立夏小满芒种夏至小暑大暑立秋处暑白露秋分寒露霜降立冬小雪大雪冬至”;
nlds=“初一初二初三初四初五初六初七初八初九初十十一十二十三十四十五十六十七十八十九二十廿一廿二廿三廿四廿五廿六廿七廿八廿九三十初一初二初三”;
wdss="星期日星期一星期二星期三星期四星期五星期六 ";
nlms=“冬月腊月正月二月三月四月五月六月七月八月九月十月冬月腊月”;
gzs=“甲子乙丑丙寅丁卯戊辰己巳庚午辛未壬申癸酉甲戌乙亥丙子丁丑戊寅己卯庚辰辛己壬午癸未甲申乙酉丙戌丁亥戊子己丑庚寅辛卯壬辰癸巳甲午乙未丙申丁酉戊戌己亥庚子辛丑壬寅癸卯甲辰乙巳丙午丁未戊申己酉庚戌辛亥壬子癸丑甲寅乙卯丙辰丁巳戊午己未庚申辛酉壬戌癸亥”;
sxs=“鼠牛虎兔龙蛇马羊猴鸡狗猪”;
whss=“海中金炉中火大林木路旁土剑锋金山头火洞下水城墙土白腊金杨柳木泉中水屋上土霹雷火松柏木长流水沙中金山下火平地木壁上土金箔金佛灯火天河水大驿土钗钏金桑松木大溪水沙中土天上火石榴木大海水”;
g12ss=“建除满平定执破危成收开闭”;
st28ss=“角亢氐房心尾箕斗牛女虚危室壁奎娄胃昴毕觜参井鬼柳星张翼轸”;
setDisplay (1);
cs.Active ();
sBarDes[0]=“输入日期”;
nBarId[0]=100;
sBarDes[1]=“显示月历”;
nBarId[1]=101;
sBarDes[2]=“生辰八字”;
nBarId[2]=102;
sBarDes[3]=“八字起时”;
nBarId[3]=103;
sBarDes[4]=“退出程序”;
nBarId[4]=104;
sBarDes[5]=“V.”;
nBarId[5]=105;
setToolBarHeight(10);
setButtonTextSize(13);
setToolBarBackgroundColor(255,192,192,192);
setButtonColor(255,0,0,190);
setButtonTextColor(255,255,245,0);
setToolBar(100,myToolBarProc,sBarDes,nBarId,6);
readDat (); //read calendar 农历 data 1900-2100
isdraw=0;
drawcover ();
while (){}
}//main ()
drawcover (){ //绘制程序封面
cs.SetTextStyle (1);
cs.SetFillMode(1);
cs.SetStrokeWidth(2);
cs.SetColor(255,0,0,128);
cs.DrawRect (6,6,713,1029);
cs.SetColor(255,255,255,255);
cs.DrawRect (65,80,190,600);
cs.SetColor(255,0,0,128);
cs.DrawRect (75,94,180,106);
cs.SetColor(255,0,0,0);
cs.SetTextSize (90);
cs.DrawText ("萬",85,200);
cs.DrawText ("年",85,320);
cs.DrawText ("曆",85,440);
cs.SetColor(255,255,0,0);
cs.SetTextSize(18);
cs.DrawText ("1900",107,510);
cs.DrawText ("2100",107,530);
cs.SetFillMode(0);
cs.DrawRect (108,493,147,535);
cs.SetColor(255,0,0,128);
cs.DrawRect (75,90,180,590);
for (i=0;i<40;i++){
cs.DrawLine (75,589,180,550+i);
cs.DrawLine (75,i+550,180,589);}
cs.SetColor(255,255,255,5);
cs.DrawLine (620,6,620,1029);
cs.DrawLine (620,100,713,100);
cs.DrawLine (620,927,713,927);
cs.DrawLine (620,375,713,375);
cs.DrawLine (620,650,713,650);
cs.SetColor(255,0,0,0);
cs.DrawCircle(620,100,1);
cs.DrawCircle(620,375,1);
cs.DrawCircle(620,650,1);
cs.DrawCircle(620,927,1);
//cs.SetFillMode(1);
cs.SetTextStyle (0);
cs.SetStrokeWidth(0);
cs.SetColor (255,255,255,0);
cs.SetTextSize (70);
s="Welcome ... ...";
cs.DrawText (s,30,950);
cs.SetFillMode(1);
cs.SetTextSize (26);
s="编译人:张纯叔 ([email protected]) ";
cs.DrawText(s,30,1000);
cs.DrawText("Version 1.5.2",460,1000);
cs.Update ();
cs.SetFillMode(1);
cs.SetStrokeWidth(1);
}//drawcover ()
drawpad (){ //draw
float pi=3.1415926535;
float sx1,sy1;
float r,L,a;
int px,py;//图中心点
if (isdraw==1){
px=522; py=220;
cs.SetFillMode (0);//0不填色,1填色
for(i=0;i<30;i++){
cs.SetFillMode (0);
cs.SetStrokeWidth(1);
a=2pi/30i; L=200;
for(k=0;k<15;k++){
cs.SetColor(255,130+k8,50+k8,250);
sx=(float)(px+(L-k*2-120)sin(a));
sy=(float)(py+(L-k2-120)cos(a));
cs.DrawOval(sx,sy,12,35,-i12);
cs.DrawLine (px,py,sx,sy);
} } //紫色团花
cs.Update (); }
}//draw
getWeekday (){//计算月首日星期几
int ds[3];
int n;
string sDat[101];
getDate(ds); //getDate = today
pickDate(“输入日期:”,ds);
sDat[n]=intToString(ds[0])+"-"+intToString(ds[1])+"-"+intToString(ds[2]);
clearOutput ();
//print ds[0],ds[1],ds[2];
dy=ds[0];
dm=ds[1];
dd=ds[2];
print “InputDate = “,dy ,”-”,dm,"-",dd;
bds=intToString(dd); //this day $
int ty;
int tm;
ty=dy;
tm=dm;
if (dm<3){
ty=dy-1;
tm=dm+12;}
//first day=1 this month
//iWeek=(d+2m+3(m+1)/5+y+y/4-y/100+y/400)
//mod 7 基姆拉尔森公式计算星期
alln=2tm+3(tm+1)/5+ty+(int)(ty/4);
alln=alln-(int)(ty/100)+(int)(ty/400)+2;
wd=alln-alln/77; //mod (alln,7)
wds=subString(wdss,wd3,3);
string yds; //for gz day wh 28star 12jian
string ydds;
double tms;
yds=“000031059090120151181212243273304334”;
ydds=subString(yds,(dm-1)*3,3);
tms=stringToDouble(ydds);
alln1=(dy-1900)365+((dy-1900-1)/4)+(int)(tms)+1;
if ((dy-dy/44)==0&&dm>2)alln1=alln1+1; //闰月
print "all days = “,alln,” ",alln1;
return ; // return weekday = wds $
}//getWeekday ()
showBZ(){
//**calculate and show this day calendar
//**显示this day,当前日的日历
//**show 生辰八字节假日
getWeekday();
calendar ();
clearOutput();
cs.ClearDraw(0,src);
cs.Update();
isdraw=1;
drawpad ();
print “input date = “,dy, “-”,dm,”-”,dd;
string gds; //for festival
//gds=subString(getds,n2,2); // show festival
cs.SetFillMode(1);
cs.SetColor (255,0,0,255);
n0=wd+dd-1;
n1=n0-n0/77; //mod (n0,7)
if(n10)cs.SetColor (255,255,0,0);
if(n16)cs.SetColor (255,255,0,0);
cs.SetTextSize (30); //print nl GZ ggzs
//print 干支年 生肖
if(dm==ysm&&dd
//取得农历月名 getms $
n1=(int)(nleap); // 闰 ?
string nlrs;
if(ysm==2){ //农历年首月为公历2月
n=dm;
if(dd
if (dd>30&&msd1<2)n=n+1;
s2=subString (das2,n+2,1);
getms=subString(nlms,n*2,2);}
if(ysm==1){ //农历年首月在公历 1月
if (dmn1+2){
nlrs="";
if (dd
cs.SetFillMode(1);
n0=wd+dd-1;
n1=n0-n0/7*7; //mod(n0,7)
dd2=intToString(dd); //print yy-mm
if(dd<10)dd2=“0”+dd2;
s=intToString (dy)+" 年 “;
s=s+intToString(dm)+” 月 ";
s1=intToString(dd);
cs.SetTextSize (50);
cs.SetColor (255,10,180,20);
cs.DrawText (s,52,83);
if(dd<10)sx=140; //居中定位显示
if (dd>9)sx=60;
cs.SetTextSize (250);
cs.DrawText (s1,sx+3,345); // print dd
cs.SetColor (255,0,0,255);
if(n1==0)cs.SetColor (255,255,0,0);
if(n1==6)cs.SetColor (255,255,0,0);
if(dm==1||dm==5||dm==6||dm==7||dm==8||dm==10){
// ** 1949年起法定节假日显示红色
if (dd==1&&dy>1948)cs.SetColor (255,255,0,0); }
if(dmysm&&ddysd-1)cs.SetColor (255,255,0,0);
if(dmysm&&ddysd)cs.SetColor (255,255,0,0);
n=dd-1;
gds=subString (getds,n*2,2);
if(getms==“正月”&&gds==“十五”)
cs.SetColor(255,255,0,0);
if(getms==“五月”&&gds==“初五”)
cs.SetColor(255,255,0,0);
if(getms==“八月”&&gds==“十五”)
cs.SetColor(255,255,0,0);
if(getms==“九月”&&gds==“初九”)
cs.SetColor(255,255,0,0);
cs.SetTextSize (50); //print yy-mm
cs.DrawText (s,50,80);
cs.SetTextSize (250); //print dd
cs.DrawText (s1,sx,340);
cs.SetTextSize (40); //print weekday
n0=wd+dd-1;
n1=n0-n0/7*7; //mod (n0,7)
s=subString (wdss,n1*3,3);
cs.SetColor (255,10,180,20); //字底色
cs.DrawText (s,152,462);
cs.SetColor (255,0,0,255);
if(n1==0)cs.SetColor (255,255,0,0);
if(n1==6)cs.SetColor (255,255,0,0);
cs.DrawText (s,150,460); //weekday
n=dd-1;
gds=subString(getds,n*2,2); // festival
//show festival ********
ss=" “;
cs.SetTextSize (36);
cs.SetColor (255,255,0,255);
i=dd;
s=gds;
print “农历月: “,getms,” “,s;
string ss1;
if(dm1&&i1)ss=“元旦节”;
if(dmysm&&iysd-1)ss=” 除夕”;
if(dmysm&&iysd)ss=” 春节";
if (dy>1948){ //1949 年起法定节假日
if(dm2&&i14)ss=“情人节”;
if(dm3&&i8)ss=“妇女节”;
if(dm3&&i12)ss=“植树节”;
if(dm5&&i1)ss=“劳动节”;
if(dm5&&i4)ss=“青年节”;
if(dm5&&imn)ss=“母亲节”;
if(dm6&&ifn)ss=“父亲节”;
if(dm6&&i1)ss=“儿童节”;
if(dm7&&i1)ss=“建党节”;
if(dm8&&i1)ss=“建军节”;
if(dm9&&i10)ss=“教师节”;
if(dm10&&i1)ss=“国庆节”; } //法定节假日
if(dm12&&i25)ss=“圣诞节”;
// if(getms==“正月”&&s==“初一”)ss1=“春节”;
if(getms==“正月”&&s==“十五”)ss1=“元宵节”;
if(getms==“二月”&&s==“初二”)ss1=“龙抬头”;
if(getms==“五月”&&s==“初五”)ss1=“端午节”;
if(getms==“七月”&&s==“初七”)ss1=“七夕节”;
if(getms==“七月”&&s==“十五”)ss1=“中元节”;
if(getms==“八月”&&s==“十五”)ss1=“中秋节”;
if(getms==“九月”&&s==“初九”)ss1=“重阳节”;
if(getms==“腊月”&&s==“初八”)ss1=“腊八节”;
if(getms==“腊月”&&s==“廿三”)ss1=" 小年";
ss=ss+ss1;
s5=" ";
if(dmysm&&iysd)s5=“弥勒佛诞”;
if (getms==“正月”&&s==“初六”)s5=“定光佛诞”;
if(getms==“二月”&&s==“初八”)s5=“释迦牟尼佛出家”;
if(getms==“二月”&&s==“十五”)s5=“释迦牟尼佛涅槃”;
if(getms==“二月”&&s==“初九”)s5=“海空上师诞”;
if(getms==“二月”&&s==“十九”)s5=“观世音菩萨诞”;
if(getms==“二月”&&s==“廿一”)s5=“普贤菩萨诞”;
if(getms==“三月”&&s==“十六”)s5=“准提菩萨诞”;
if(getms==“四月”&&s==“初四”)s5=“文殊菩萨诞”;
if(getms==“四月”&&s==“初八”)s5=“释迦牟尼佛诞”;
if(getms==“四月”&&s==“十五”)s5=“佛吉祥日 卫塞节”;
//“0415 佛吉祥日——释迦牟尼佛诞生、成道、涅槃三期同一庆(即南传佛教国家的卫塞节)”,
if(getms==“五月”&&s==“十三”)s5=“伽蓝菩萨诞”; if(getms==“六月”&&s==“初三”)s5=“护法韦驮尊天菩萨诞”;
if(getms==“六月”&&s==“十九”)s5=“观世音菩萨成道”;
// 此日放生、念佛,功德殊胜
if(getms==“七月”&&s==“十三”)s5=“大势至菩萨诞”;
if(getms==“七月”&&s==“廿四”)s5=“龙树菩萨诞”;
if(getms==“七月”&&s==“三十”)s5=“地藏菩萨诞”;
if(getms==“八月”&&s==“廿二”)s5=“燃灯佛诞”;
if(getms==“九月”&&s==“十九”)s5=“观世音菩萨出家”;
if(getms==“九月”&&s==“三十”)s5=“药师琉璃光如来诞”;
if(getms==“十月”&&s==“初五”)s5=“达摩祖师诞”;
if(getms==“冬月”&&s==“初七”)s5=“阿弥陀佛诞”;
if(getms==“腊月”&&s==“初八”)s5=“释迦如来成道日”;
if(getms==“腊月”&&s==“廿九”)s5=“华严菩萨诞”;
string jqss; //显示节气
if (ijqd1)jqss=“今日”+jqs1;
if (ijqd2)jqss=“今日”+jqs2;
n=0;
cs.DrawText (ss,473-n,458); //show festival
cs.SetTextSize (30);
k=len (s5)*24/2;
cs.DrawText (s5,510-k,380); //show festival
cs.DrawText (jqss,463,410);
cs.SetTextSize (30); // show GZ 八字
cs.SetColor(255,255,0,255);
s="今日"+bzs;
cs.DrawText (s,20,760);
s1=subString (whss,(gzy/2)*3,3);
s2=subString (whss,(gzm/2)*3,3);
s3=subString (whss,(gzd/2)*3,3);
s4=subString (whss,(gzh/2)*3,3);
s="年 : "+gzys+" "+s1; //show 五行纳音
cs.DrawText (s,20,810);
s="月 : "+gzms+" "+s2;
cs.DrawText (s,20,840);
s="日 : "+gzds+" "+s3;
cs.DrawText (s,20,870);
s="时 : "+gzhs+" "+s4;
cs.DrawText (s,20,900);
n=alln1+3; //print 28 宿
n1=n-n/28*28; //mod (n,28)
ss=subString (st28ss,n1,1);
cs.DrawText (ss,245,870);
n=alln1-(dy-1900)*12-dm+10; //show 12建日 每月 减1 天 ( -dm )
if (dd>=jqd1)n=n-1; //逢节气日 重复前一日建星神值
n1=n-n/12*12; //mod (n,12)
ss=subString(g12ss,n1,1);
cs.DrawText (ss,275,870);
//以下是调试时的数据
print “当日 : “+dy2+”-”+dm2+"-"+dd2;
print "alln = ",alln;
print "alln1 = ",alln1;
print "年首月: ",(int)(ysm);
print "年首日: ",(int)(ysd);
print "das2 = ",das2;
print "weekday = ",wd;
print "星期$ ",wds;
print "干支 : ",ggzs;
print "农历日 : ",getds;
print "节气 >节 “,jqd1,” ", jqss1;
print "节气 >气 “,jqd2,” ", jqss2;
print bzs; //BZ $
print "干支年 月 日 时 : “, gzy,” “,gzm,” “,gzd,” ",gzh;
print "月首日 : ", msd1;
print "上年冬至 = “,dzd0,” 本年冬至 = ",dzd1;
x0=360;
y0=800;
cs.SetTextSize(24);
s=" 起时 : ";
cs.DrawText(s,x0,y0);
s="23 - 1 11 - 13";
cs.DrawText(s,x0,y0+30);
s=" 1 - 3 13 - 15";
cs.DrawText(s,x0,y0+60);
s=" 3 - 5 15 - 17";
cs.DrawText(s,x0,y0+90);
s=" 5 - 7 17 - 19";
cs.DrawText(s,x0,y0+120);
s=" 7 - 9 19 - 21";
cs.DrawText(s,x0,y0+150);
s=" 9 - 11 21 - 23";
cs.DrawText(s,x0,y0+180);
for(i=0;i<6;i++){
s1=subString(gzs,(gzh+i)*2,2);
s2=subString(gzs,(gzh+6+i)*2,2);
s=s1+" "+s2;
cs.DrawText(s,x0+80,y0+30+i*30);}
//以下显示九九三伏入梅出梅
//芒种后丙日入梅 小暑后未日出梅
int jjiu,jiu1,jiu2; //print and show 九九
string jius;
jius=“一二三四五六七八九”;
cs.SetTextSize (30);
if (dm>11&&dd>=dzd1||dm<4){
if(dm12&&dd>=dzd1)jjiu=dd-dzd1;
if(dm1)jjiu=31-dzd0+dd;
if(dm2)jjiu=31-dzd0+31+dd; if(dm3&&dd<13)jjiu=31-dzd0+31+28+dd;
jiu2=jjiu-(int)(jjiu/9*9)+1;
jiu1=(int)(jjiu/9)+1;
print "jiu1 = “,jiu1,” jiu2 = ",jiu2;
s0=subString (jius,jiu1-1,1);
s1=intToString (jiu2);
ss=s0+"九第 “+s1+” 天 “;
if(jjiu>80)ss=” “;
print jjiu;
print ss;
if (dm==3&&dd>12)ss=” ";
cs.DrawText (ss,495,540);
} //show 九九
ss=" ";
if (dm==6&&dd>4&&dd<17){
s0=subString (gzds,0,1);
if (s0=="丙"){ ss="今日入梅";}else{ss=" ";}
cs.DrawText (ss,500,540);}
if (dm==7&&dd>6&&dd<18){
s0=subString (gzds,1,1);
if (s0=="未"){ ss="今日出梅";}else{ss=" ";}
cs.DrawText (ss,500,540);}
//show fu day ******
// 夏至后第三个庚日起10天为初伏
//夏至后第四个庚日到立秋后第一个庚日为中伏
//立秋后第一个庚日起10天为末伏
int fn;
string fu1,fu2,fu3;
fu1=“初伏第”;
fu2=“中伏第”;
fu3=“末伏第”;
n=(dd-dd/10*10)-((gzd-gzd/10*10)-6);
if (n<10)n=n+10;
print n," 日干支 庚日 ",gzd;
if (dm==7&&dd>n-1){
n0=dd-n+1;
print n0;
if (dd>n-1&&dd<=n+9){
s=fu1+intToString (n0);}
if (dd>n+9){
s=fu2+intToString (n0-10);}
ss=s+“天”;
cs.DrawText (ss,495,540); }
if (dm==8){
if (dd=n){ss=fu3+intToString (n0-20)+"天";}
cs.DrawText (ss,495,540);}
} //show 三伏
setDisplay (1);
cs.Update ();
cs.Active ();
}//showBZ()
calnlds(){
//calculate 农历月$ getms
//计算 农历日$ getds
s=daList[dy-1];
das0=s;
print "last year = ",dy-1;
print "last year das0 = ", das0;
s=daList[dy];
das1=s;
print "this year = ",dy;
print "this year das1 = ",das1;
s=subString(das1,15,1);
ysm=stringToDouble(s);
print "年首月 = ",(int)(ysm);
s=subString(das1,16,2);
ysd=stringToDouble(s);
print "月首日 = ",(int)(ysd);
s=subString(das1,13,1);
nleap=stringToDouble (s);
n=(int)(nleap);
s=subString(das1,12,1);
nleapd=stringToDouble (s);
print " nleap = “, nleap,” ",nleapd;
if(nleap==0){
ss=subString (das0,10,2)+subString (das1,0,12);
}else {ss=subString(das0,11,1)+subString(das1,0,n)+subString(das1,12,1)+subString(das1,n,12-n);}
das2=ss;
print "new das2 = ",das2;
print " ";
//calculate msd(12) // 年 月朔日$
n0=(int)(ysd); //年首日起算
if (dy-(int)(dy/4)*40){leap=1;}else{leap=0;}
//print "leap = ",leap;
if (ysm1){
s=subString(das2,1,1);
if (s==“1”){n=30;}else{n=29;}
msd[1]=n0;
msd[2]=msd[1]+n-31; }
if (ysm2){
s=subString(das2,1,1);
if (s"1"){n=30;}else{n=29;}
msd[1]=31+n0-n;
msd[2]=n0; }
s=subString(das2,2,1);
if (s==“1”){n=30;}else{n=29;}
msd[3]=msd[2]+n-28-leap;
s=subString(das2,3,1);
if (s==“1”){n=30;}else{n=29;}
msd[4]=msd[3]+n-31;
s=subString(das2,4,1);
if (s==“1”){n=30;}else{n=29;}
msd[5]=msd[4]+n-30;
s=subString(das2,5,1);
if (s==“1”){n=30;}else{n=29;}
msd[6]=msd[5]+n-31;
s=subString(das2,6,1);
if (s==“1”){n=30;}else{n=29;}
msd[7]=msd[6]+n-30;
s=subString(das2,7,1);
if (s==“1”){n=30;}else{n=29;}
msd[8]=msd[7]+n-31;
s=subString(das2,8,1);
if (s==“1”){n=30;}else{n=29;}
msd[9]=msd[8]+n-31;
s=subString(das2,9,1);
if (s==“1”){n=30;}else{n=29;}
msd[10]=msd[9]+n-30;
s=subString(das2,10,1);
if (s==“1”){n=30;}else{n=29;}
msd[11]=msd[10]+n-31;
s=subString(das2,11,1);
if (s==“1”){n=30;}else{n=29;}
msd[12]=msd[11]+n-30;
print "全年朔日 : ";
for(i=1;i<13;i++){
print "dm= “,i,” ",msd[i];}
getds=" ";
n0=msd[dm]; //msd 月朔日
s=subString(das2,dm-1,1);
if (n0<=1) s=subString (das2,dm,1);
if(s==“1”){n=30;}else{n=29;}
//lmd=n; //上月农历天数
if(n0<=1)n0=n+n0;
msd1=n0;
print "月朔日 : ”,n0;
string gs1,gs2;
gs1=subString(nlds,(n-n0+1)*2,(n0-1)*2);
gs2=subString(nlds,0,(31-n0+1)*2);
getds=gs1+gs2;
print getds; //农历日$
//农历月名$
n1=(int)(nleap); //2017 nleap n1=6;
if(ysm==2) getms=subString(nlms,dm*2,2);
if(ysm==1){
if(dmn1+1)getms=subString(nlms,dm*2,2);
}
print "月份 = ",dm," , 农历月 = ",getms;
}//calnlds ()
calendar(){ //绘制显示月历
//calculate and show month calendar ************
calnlds(); //取得农历月日$ getms, getds
cs.ClearDraw (0,src);
//string fname; //贴图:预先准备的手机根目录底图
// fname="/storage/emulated/0/view01.jpg";
// cs.DrawBitmap(fname,0,2);
isdraw=0;
drawpad ();
// print " show weekday = ",wd;
cs.SetTextStyle (1); //粗体
cs.SetStrokeWidth (1);
cs.SetTextSize (300); //print big dm
cs.SetColor (200,0,220,0);
s=intToString (dm);
if (dm<10){sx=250;}else{sx=170;}
cs.DrawText (s,sx,595);
cs.SetTextSize (19);
cs.SetColor (255,255,0,0);
s="星期日";
cs.DrawText (s,103,230);
s="星期六";
cs.DrawText (s,522,230);
cs.SetColor(255,0,0,240);
s="星期一 星期二 星期三 星期四 星期五”;
cs.DrawText (s,176,230);
cs.DrawLine(50,200,630,200);
cs.DrawLine(50,250,630,250);
cs.DrawLine(50,750,630,750);
cs.SetTextSize (66); //print yymm
s=intToString (dy)+" · ";
leap=0;
n=0;
if (dm<10)n=20;
s1=intToString (dm);
cs.SetColor(220,0,90,0);
cs.DrawText (s+s1,320+n+4,180+3);
cs.SetColor(255,0,0,240);
cs.DrawText (s+s1,320+n,180);
cs.SetFillMode (0);//0不填色,1填色
cs.SetColor(255,250,160,0);
cs.DrawText (s+s1,320+n,180); //print yymm
cs.SetColor(255,0,0,240);
cs.SetFillMode (1);//0不填色,1填色
//**** calculate solarterm //show 节气
dy2=intToString(dy); //show 节气
dm2=intToString(dm);
dy1=stringToDouble(dy2);
dm1=stringToDouble(dm2);
cs.SetTextSize (30);
dy0=dy1;
n=dm*2-1;
caljq();
jqd1=(int)(dd1);
jqs1=subString(jname2,0,2);
cs.DrawText (jname2,50,790);
jqss1=jname2;
n=dm*2;
caljq ();
jqd2=(int)(dd1);
jqs2=subString(jname2,0,2);
cs.DrawText(jname2,50,830);
jqss2=jname2;
if (dm==12)dzd1=jqd2; //show 九九
print "本年冬至:”,dzd1;
if (dm<4){
n=24;
dy0=dy1-1;
caljq ();
dzd0=(int)(dd1);
print "上年冬至:”,dzd0;}
if(dm==1)s="January";
if(dm==2)s="February";
if(dm==3)s="March";
if(dm==4)s="April";
if(dm==5)s="May";
if(dm==6)s="June";
if(dm==7)s="July";
if(dm==8)s="August";
if(dm==9)s="September";
if(dm==10)s="October";
if(dm==11)s="Novamber";
if(dm==12)s="December";
sx=(1100-len(s)*20)/2;
cs.SetTextSize (28);
cs.DrawText (s,sx,80);
//print 干支年 生肖
if(ysm==2&&dm==1){n=dy-4-1;}else{n=dy-4;}
gzn=(n-n/60*60);
//print "gzn = ",gzn;
ggzs=subString(gzs,gzn*2,2);
// print "gz $ = ",ggzs;
if (ysm==1)s1=subString(nlms,dm*2,2);
if (ysm==2)s1=subString(nlms,dm*2,2);
s1=getms; //print "正月"
if(s1=="冬月")s1="十一月";
if(s1=="腊月")s1="十二月";
if (ysm==1)s2=subString(das2,dm+0,1);
if (ysm==2)s2=subString (das2,dm+0,1);
if(s2=="1"){s2="大";}else{s2="小";}
s=ggzs+"年"+s1+s2;//年干支
sxn=gzn-gzn/12*12;//生肖
gsxs=subString(sxs,sxn,1);
ggzs=s+"("+gsxs+")";
cs.DrawText(ggzs,60,180);
cs.SetColor (255,0,0,240);
if(dm==1)ns=32;
if(dm==2)ns=29;
if (dy/4*4==dy)leap=1;
if (dm==2&&leap==1)ns=30;
if(dm==3)ns=32;
if(dm==4)ns=31;
if(dm==5)ns=32;
if(dm==6)ns=31;
if(dm==7)ns=32;
if(dm==8)ns=32;
if(dm==9)ns=31;
if(dm==10)ns=32;
if(dm==11)ns=31;
if(dm==12)ns=32;
fmn=0;
for (i=1;i1948){
if (dm==1||dm==5||dm==6||dm==7||dm==8||dm==10){
cs.SetColor(255,255,0,0); } // 法定节假日 红色 }
if(dmysm&&iysd-1)cs.SetColor (255,255,0,0);
if(dmysm&&iysd)cs.SetColor (255,255,0,0);
if(getms==“八月”&&s==“十五”)setc=12; //red
if (sx==0)fmn=fmn+1;
if (dm==5&&fmn==2&&sx==0)mn=i;
if (dm==6&&fmn==3&&sx==0)fn=i;
//for father mather festival
x1=sx*70+114;
y1=sy*80+300;
s=intToString(i);
n=0;
if (len(s)==1)n=10;
cs.DrawText (s,x1+n,y1); //print date$
cs.SetTextSize (20);
// **** s="初一"; //打印农历日期 *******
n=0;
s=subString (getds,(i-1)*2,2); //print dd$
s2=s;
if(s=="初一"){
s=getms; //print "正月"
if (msd[dm]<2&&i>22)s=subString (nlms,(dm+1)2,2);
if(s==“冬月”)s=“十一月”;
if(s==“腊月”)s=“十二月”;
if(s==“腊月”)s1=“十二月”; }
//*** show festival ***************
//**** putout solarterm on table
if(ijqd1)s=jqs1;
if(ijqd2)s=jqs2;
// print mn,fn;
if(dm1&&i1)s=“元旦节”;
if(dmysm&&iysd-1)s=“除夕”;
if(dmysm&&iysd)s=“春节”;
if (dy>1948){ //法定节假日
if(dm2&&i14)s=“情人节”;
if(dm3&&i8)s=“妇女节”;
if(dm3&&i12)s=“植树节”;
if(dm5&&i1)s=“劳动节”;
if(dm5&&i4)s=“青年节”;
if(dm5&&imn)s=“母亲节”;
if(dm6&&ifn)s=“父亲节”;
if(dm6&&i1)s=“儿童节”;
if(dm7&&i1)s=“建党节”;
if(dm8&&i1)s=“建军节”;
if(dm9&&i10)s=“教师节”;
if(dm10&&i1)s=“国庆节”; } //法定节假日
if(dm12&&i25)s=“圣诞节”;
if(dm2&&getms"正月"&&s2==“十五”){s=“元宵节”;setc=12;}
if(dm2&&getms"二月"&&s2==“十五”){s=“元宵节”;setc=12;}
if(dm3&&i<10&&getms"二月"&&s2==“十五”){s=“元宵节”;setc=12;}
if(dm2&&getms"二月"&&s2==“初二”)s=“龙抬头”;
if(dm3&&getms"二月"&&s2==“初二”)s=“龙抬头”;
if(dm5&&getms"五月"&&s2==“初五”){s=“端午节”; setc=12;}
if(dm6&&getms"五月"&&s2==“初五”){s=“端午节”; setc=12;}
if(dm7&&getms"七月"&&s2==“初七”)s=“七夕节”;
if(dm8&&getms"七月"&&s2==“初七”)s=“七夕节”;
if(ysm1&&getms"八月"&&s2==“十五”)s=“中元节”;
if(ysm2&&getms"七月"&&s2==“十五”)s=“中元节”;
if(ysm1&&getms"九月"&&s2==“十五”&&i<20){s=“中秋节”;setc=12;}
if(ysm2&&getms"八月"&&s2==“十五”){s=“中秋节”;setc=12;}
//if(ysm1&&getms"十月"&&s2==“初九”){s=“重阳节”; setc=12;}
if(getms==“九月”&&s2==“初九”){s=“重阳节”;setc=12;}
if(ysm1&&getms"正月"&&s2==“初八”&&i<20)s=“腊八节”;
if(ysm2&&getms"腊月"&&s2==“初八”)s=“腊八节”;
if(ysd<8&&s1==“十二月”&&s2==“廿三”)s=“小年”;
if(ysd>=8&&s1==“正月”&&s2==“廿三”)s=“小年”;
// cs.SetColor (255,255,0,0);
if (setc==12)cs.SetColor (255,255,0,0);
if (len(s)3)n=10;
cs.DrawText(s,x1-2-n,y1+30);
cs.SetColor (100,250,250,20);
if(ddi){ //draw today mark
cs.DrawRect (x1-10,y1-30,x1+45,y1+10);}
} //print a.d. dd$ festival
//calculate GZ,gzy,gzm,gzd,alln 生辰八字
print “节气日 : “,jqd1;
alln1=alln1+dd-1; //all days
n=(dy+2096);
if(dm<2)n=n-1;
if(dm==2&&dd
s1=subString(gzs,gzy2,2);
if(dd
gzm=gzn1-(int)(gzn1/6060);
s2=subString (gzs,gzm2,2);
n1=alln1+9;
gzd=n1-(int)(n1/6060);
s3=subString(gzs,gzd2,2);
gzh=(gzd-(int)(gzd/55))12;
s4=subString(gzs,gzh2,2);
cs.SetColor(255,255,0,240);
cs.SetTextSize(30);
if(len(bds)==1)bds=“0”+bds;
s=“日期 : “+dy2+” 年 “+dm2+” 月 “+bds+ " 日”;
cs.DrawText(s,50,870);
gzys=s1;
gzms=s2;
gzds=s3;
gzhs=s4;
s=“八字 : “+s1+” “+s2+” “+s3+” “+s4;
bzs=s; //bazi y,m,d,h
cs.DrawText(s,50,910);
print bzs;
x0=400;
y0=800;
cs.SetTextSize(24);
s=“起时 : “;
cs.DrawText(s,400,y0);
s=“23 - 1 11 - 13”;
cs.DrawText(s,400,y0+30);
s=” 1 - 3 13 - 15”;
cs.DrawText(s,400,y0+60);
s=” 3 - 5 15 - 17”;
cs.DrawText(s,400,y0+90);
s=” 5 - 7 17 - 19”;
cs.DrawText(s,400,y0+120);
s=” 7 - 9 19 - 21";
cs.DrawText(s,400,y0+150);
s=" 9 - 11 21 - 23";
cs.DrawText(s,400,y0+180);
for(i=0;i<6;i++){
s1=subString(gzs,(gzh+i)*2,2);
s2=subString(gzs,(gzh+6+i)2,2);
s=s1+" "+s2;
cs.DrawText(s,480,y0+30+i30);}
setDisplay (1);
cs.Update ();
}//calendar () ***********************
myToolBarProc(int nBtn,int nContext) {
if(nBtn100){//计算星期, 显示月历
getWeekday();
print “weekday = “,wd;
print “get weekday = “,dy ,”-”,dm,”-”,1;
print "weekday$ ? = ",wds;
calendar();
}
if(nBtn101){//显示月历 calendar
if (isdraw0){
getWeekday ();
calendar (); }else{ calendar (); }
setDisplay (1);
}
if(nBtn102){//显示 生辰八字
showBZ ();
}
if(nBtn103){//显示 八字起时
setDisplay (0);
print " ";
print "八字起时 > : ";
print " “;
for (i=0;i<30;i++){
gzh=i2;
s1=subString (gzs,(gzh2),2);
s2=subString (gzs,(gzh2+2),2);
s4=subString (whss,i3,3);
s=s1+” “+s2+” : "+s4;
print s;}
}
if(nBtn104){//退出程序
clearOutput();
cs.ClearDraw (0,src);
setDisplay (0);
exit (0);
}
if(nBtn==105){//版本信息
setDisplay (1);
drawcover (); }
}//Toolbar () ***********************
caljq(){//calculate solar ** return jname2
juD=dy0*(365.2423112-0.000000000000064
(dy0-100)(dy0-100)- 0.00000003047
(dy0-100))+15.218427n+1721050.71301;
//juD=juD-0.00215;
tht=0.0003dy0-0.372781384-0.2617913325n;
yrD=(1.945sin(tht)-0.01206sin(2tht))
(1.048994-0.00002583 dy0);
sD=-0.0018sin(2.313908653dy0
-0.439822951-3.0443n);
//'vs = juD '** 平气
vs = (juD + yrD + sD); // '** 定气
dalt=-15+(juD-2382148)(juD-2382148)/41048480;
//print dalt;
dalt = dalt/86400;
//print dalt;
jd = vs - 0.5 - dalt-0.026; // + 0.008;
int gg;
gg=n-(int)(n/22);
jdtoGD ();
//jqs1=subString (jqnames,(n-1)*2,2);
//print "jqs1 = “,jqs1;
s=jqs1+” " +jname2;
//print jname2;
}//caljq() ***********************************
//calculate jd to GD ** return jname2 *****
jdtoGD(){
double a,b,c,d,e;
double F;
double allss;
F=jd-(int)(jd);
//print " ";
//print " JD = ",jd;
//print " 时分秒 日小数 = “,F;
a=(int)(jd+0.5);
b=a+1537;
c=(int)((b-122.1)/365.25);
d=(int)(365.25c);
e=(int)((b-d)/30.6001);
dd1=b-d-(int)(30.6001e);
dm1=e-1-(int)((e/14)*12);
dy1=c-4715-(int)((7+dm1)/10);
//print a,” “,b,” “,c,” “,d,” ",e;
dy2=intToString (dy);
dm2=intToString (dm);
dd2=doubleToString (dd1);
if (len(dm2)1)dm2=“0”+dm2;
if (dd1<10)dd2=“0”+dd2;
dd2=subString (dd2,0,2);
//print dy2+" 年 “+dm2+” 月 “+dd2+” 日 ";
if(n24)jqdn=(int)(dd1);
if (n==24&&dm1<3)jqdn=jqdn+1;
//日allss 的小数转为时分秒
allss=(int)((jd-a)86400+43200.5);
//print "allss = ", allss;
hh1=(int)(allss/3600);
mm1=(int)((allss-hh13600)/60);
ss1=(int)(allss-hh13600-mm160);
if(ss1>=60){
ss1=ss1-60;
mm1=mm1+1;}
if(mm1>=60){
mm1=mm1-60;
hh1=hh1+1;}
//print “JD 转为 GD,计算结果:”;
hh2=doubleToString(hh1);
mm2=doubleToString(mm1);
ss2=doubleToString(ss1);
if(hh1<10){
hh2=“0”+doubleToString(hh1);}
if(mm1<10){
mm2=“0”+doubleToString(mm1);}
if(ss1<10){
ss2=“0”+doubleToString(ss1);}
hh2=subString (hh2,0,2);
mm2=subString (mm2,0,2);
ss2=subString (ss2,0,2);
jname1=subString(jqnames,(n-1)*2,2);
//print “节气 : “,jname1;
jname2=jname1+” > “+dm2+”-”+dd2+” “+hh2+”:"+mm2+":"+ss2;
//print jname2;
}//jdtoGD() **************
readDat(){
daList[1899] = “101010110101000210”;
daList[1900] = “010010111101080131”;
daList[1901] = “010010101110000219”;
daList[1902] = “101001010111000208”;
daList[1903] = “010100100110050129”;
daList[1904]= “110100100110000216”;
daList[1905] = “110110010101000204”;
daList[1906]= “011010101010140125”;
daList[1907] = “010101101010000213”;
daList[1908] = “100110101101000202”;
daList[1909]= “010010101110020122”;
daList[1910]= “010010101110000210”;
daList[1911] = “101001001101060130”;
daList[1912]= “101001001101000218”;
daList[1913]= “110100100101000206”;
daList[1914] = “110101010100150126”;
daList[1915]= “101101010101000214”;
daList[1916]= “010101101010000204”;
daList[1917]= “100101101101020123”;
daList[1918]= “100101011011000211”;
daList[1919]= “010010011011170201”;
daList[1920]= “010010011011000220”;
daList[1921]= “101001001011000208”;
daList[1922]= “101100100101050128”;
daList[1923]= “011010100101000216”;
daList[1924] = “011011010100000205”;
daList[1925] = “101011011010140124”;
daList[1926] = “001010110110000213”;
daList[1927] = “100101010111000202”;
daList[1928]= “010010010111020123”;
daList[1929]= “010010010111000210”;
daList[1930] = “011001001011060130”;
daList[1931] = “110101001010000217”;
daList[1932] = “111010100101000206”;
daList[1933] = “011011010100150126”;
daList[1934] = “010110101101000214”;
daList[1935] = “001010110110000204”;
daList[1936]= “100100110111130124”;
daList[1937] = “100100101110000211”;
daList[1938]= “110010010110170131”;
daList[1939] = “110010010101000219”;
daList[1940] = “110101001010000208”;
daList[1941]= “110110001010160127”;
daList[1942] = “101101010101000215”;
daList[1943]= “010101101010000205”;
daList[1944] = “101010101101140125”;
daList[1945]= “001001011101000213”;
daList[1946] = “100100101101000202”;
daList[1947]= “110010010101020122”;
daList[1948]= “101010010101000210”;
daList[1949]= “101101010101070129”;
daList[1950] = “011011001010000217”;
daList[1951] = “101101010101000206”;
daList[1952] = “010101011010150127”;
daList[1953]= “010011011010000214”;
daList[1954]= “101001011011000203”;
daList[1955]= “010100101011130124”;
daList[1956] = “010100101011000212”;
daList[1957] = “101010010101080131”;
daList[1958] = “111010010101000218”;
daList[1959]= “011010101010000208”;
daList[1960]= “101011010101060128”;
daList[1961] = “101010110101000215”;
daList[1962] = “010010110110000205”;
daList[1963] = “101001010111040125”;
daList[1964]= “101001010111000213”;
daList[1965]= “010100100110000202”;
daList[1966]= “111010010011030121”;
daList[1967] = “110110010101000209”;
daList[1968]= “010110101010070130”;
daList[1969] = “010101101010000217”;
daList[1970]= “100101101101000206”;
daList[1971]= “010010101110050127”;
daList[1972]= “010010101101000215”;
daList[1973]= “101001001101000203”;
daList[1974]= “110100100110040123”;
daList[1975]= “110100100101000211”;
daList[1976]= “110101010010080131”;
daList[1977]= “101101010100000218”;
daList[1978]= “101101101010000207”;
daList[1979]= “100101101101160128”;
daList[1980]=“100101011011000216”;
daList[1981]=“010010011011000205”;
daList[1982]=“101011001011040125”;
daList[1983]=“101001001011000213”;
daList[1984]=“1011001001110a0202”;
daList[1985]=“011010100101000220”;
daList[1986]=“011011010100000209”;
daList[1987]=“101011011010060129”;
daList[1988]=“101010110110000217”;
daList[1989]=“100100110111000206”;
daList[1990]=“010010010111050127”;
daList[1991]=“010010010111000215”;
daList[1992]=“011001001011000204”;
daList[1993]=“011010100101030123”;
daList[1994]=“111010100101000210”;
daList[1995]=“011010110010080131”;
daList[1996]=“010110101100000219”;
daList[1997]=“101010110110000207”;
daList[1998]=“100101101101050128”;
daList[1999]=“100100101110000216”;
daList[2000]=“110010010110000205”;
daList[2001]=“110101001010040124”;
daList[2002]=“110101001010000212”;
daList[2003]=“110110100101000201”;
daList[2004]=“010110101010020122”;
daList[2005]=“010101101010000209”;
daList[2006]=“101010111011070129”;
daList[2007]=“001001011101000218”;
daList[2008]=“100100101101000207”;
daList[2009]=“110010101011050126”;
daList[2010]=“101010010101000214”;
daList[2011]=“101101001010000203”;
daList[2012]=“101110101010040123”;
daList[2013]=“101011010101000210”;
daList[2014]=“010101011101090131”;
daList[2015]=“010010111010000219”;
daList[2016]= “101001011011000208”;
daList[2017]= “010100010111160128”;
daList[2018]= “010100101011000216”;
daList[2019]= “101010010011000205”;
daList[2020]= “011110010101040125”;
daList[2021]= “011010101010000212”;
daList[2022]= “101011010101000201”;
daList[2023]= “010110110101020122”;
daList[2024]= “010010110110000210”;
daList[2025]= “101001101110060129”;
daList[2026]= “101001001110000217”;
daList[2027]= “110100100110000206”;
daList[2028]= “111010100110050126”;
daList[2029]= “110101010011000213”;
daList[2030]= “010110101010000203”;
daList[2031] = “011101101010030123”;
daList[2032]= “100101101101000211”;
daList[2033] = “010010111101070131”;
daList[2034]= “010010101101000219”;
daList[2035] = “101001001101000208”;
daList[2036]= “110100001011060128”;
daList[2037]= “110100100101000215”;
daList[2038] = “110101010010000204”;
daList[2039] = “110111010100050124”;
daList[2040]= “101101011010000212”;
daList[2041]= “010101101101000201”;
daList[2042]= “010101011011020122”;
daList[2043]= “010010011011000210”;
daList[2044]= “101001010111070130”;
daList[2045]= “101001001011000217”;
daList[2046]= “101010100101000206”;
daList[2047] = “101100100101150126”;
daList[2048] = “011011010010000214”;
daList[2049] = “101011011011000202”;
daList[2050]= “011101101010050124”;
daList[2051]= “100100110111000211”;
daList[2052]= “010010011111080201”;
daList[2053] = “010010010111000219”;
daList[2054]= “011001001011000208”;
daList[2055] = “011010001010160128”;
daList[2056] = “111010100101000215”;
daList[2057]= “011010110010000204”;
daList[2058] = “101001111100140124”;
daList[2059] = “101010101110000212”;
daList[2060]= “100100101110000202”;
daList[2061]= “110100101110030121”;
daList[2062] = “110010010110000209”;
daList[2063] = “110101010101070129”;
daList[2064]= “110101001010000217”;
daList[2065] = “110110100101000205”;
daList[2066]= “010111010101050126”;
daList[2067] = “010101101010000214”;
daList[2068]= “101001101101000203”;
daList[2069]= “010101011101040123”;
daList[2070]= “010101101101000211”;
daList[2071] = “101010011011080131”;
daList[2072] = “101010010101000219”;
daList[2073]= “101101001010000207”;
daList[2074] = “101101101010060127”;
daList[2075] = “101011010101000215”;
daList[2076] = “010101011010000205”;
daList[2077] = “101010111010040124”;
daList[2078]= “101001011011000212”;
daList[2079]= “010100101011000202”;
daList[2080] = “101100100111030122”;
daList[2081]= “011010010011000209”;
daList[2082] = “011100110011070129”;
daList[2083] = “011010101010000217”;
daList[2084]= “101011010101000206”;
daList[2085] = “010010110101150126”;
daList[2086]= “010010110110000214”;
daList[2087]= “101001010111000203”;
daList[2088]= “010101001110040124”;
daList[2089] = “110100010110000210”;
daList[2090]= “111010010110080130”;
daList[2091]= “110101010010000218”;
daList[2092] = “110110101010000207”;
daList[2093]= “011010101010060127”;
daList[2094] = “010101101101000215”;
daList[2095]= “010010101110000205”;
daList[2096]= “101010011101040125”;
daList[2097] = “101001001101000212”;
daList[2098] = “110100010101000201”;
daList[2099] = “111100100101020121”;
daList[2100] = “110101010010000209”;
return;
}