可调整界面输出的桌面万年历设计
本文主要介绍月历和生辰八字五行的界面输出方法。一个有趣的方法是可调整界面输出格式,显示几种屏幕排版的布局。本文示例了四个式样。算法的精髓是用一种简单的算法来设置调节屏幕打印输出。分三个显示内容,即月历、大字日历、生辰八字五行。设置三个打印位置的定位基准点,此法暂称为十字坐标定位打印法,就是先定一个十字坐标点,即left和top,俗称左上角。只要改变它的值就能达到各种排版的要求。
台历式显示月历就是公历和农历格式化打印,7天一星期表式打印输出。农历显示包括初一改为那个月,是节气日期改为节气名称,法定节假日显示。节假日既然是国家法定的,那就应从1949年开始显示。其实各节日哪时开始要考证,故且从权统一从1949年开始。此前也就只显示传统节日。
本文介绍月历格式化打印方法,此法也用十字坐标定位打印法,就是先定一个十字坐标点,即left和top。接下来所有打印显示的内容都按此点来计算。此方法的优点是很容易在屏幕上改变打印位置,这是排版的要点,若要所见即所得排版A4或A3纸张上打印输出,就很容易实现。用图片框作载体,装载底图,调整底图位置,再定点打印月历,就能打印出很酷的月历。
此法还可以制作pc视窗的桌面透明万年历。用无框窗体加透明图片贴图加月历打印输出就能实现透明万年历的制作。有兴趣的可试试,很酷的。我用VB6就做过。可参阅我本站上传的资源文档。
节气交节时刻计算,天文算法很精准,但太复杂,数据数组方法数据量太大,都不合适。如要求精确时间,可用数据数组方法。本程序采用曾次亮先生的算法,算法简单,但精度差些。如要精准度就采用数据数组方法,200年的数据量还可以,现在存储和内存容量都较大。我已编译了数据,需要的可索取。
我早先编制一程序用于采集农历数据和节气时间数据,数据底本是依据许剑伟先生的寿星万年历的输出打印表。编制的农历数据有公元前1600年到公元3000年和节气时间数据公元1600年至3000年。公元1600年以前的节气时间数据和历史上历朝历代发布的时间差距较大。我编制的程序软件主要适用于历史研究和考古研究,1600年前的节气时刻要参照古历法所记载这些数据。数据文件有需要的可索取。( 联系方法:micelu@126.com )
【 附录 】节气数据法示例:
jqdata[2023] = " 05 23:04:38 20 16:29:20 04 10:42:20 19 06:34:05 06 04:36:01 21 05:24:13 05 09:12:51 20 16:13:25" ; //2023年小寒起部份数据
dy=2023 ; dm=2 ;
dm2=intToString (dm) ;
if (dm<10) dm2="0"+dm2 ; //format
ss=jqdata[dy] ; //取年全部数据
s1=subString (ss, dm*24-24, 24) ; //截取月数据
print "ss = "+ss ;
print "截取数据 : "+s1 ;
jqs1=subString (jqnames, (dm*2-1)*2-2, 2);
jqs1=jqs1+" "+dm2+"-"+subString (s1, 1, 12) ;
jqs2=subString (jqnames, dm*2*2-2, 2);
jqs2=jqs2+" "+dm2+"-"+subString (s1, 13, 12) ;
print "----------------------------------------------" ;
print jqs1 ; //打印节气
print jqs2 ; //打印中气
输出打印示例:
截取数据 : 04 10:42:20 19 06:34:05
----------------------------------------------
立春 02-04 10:42:20
雨水 02-19 06:34:05
生辰八字>>显示指定查询日生辰八字。生辰八字就是年月日六字加另列出的时辰二字。
另外还显示日柱八字的五行二十八宿十二建的排列字,如:甲寅 大溪水胃满 。
八字都有显示五行纳音,如:甲子 海中金 。
民间有俗称今年是金猪年金猴年。其实要看年柱的五行,如:
1984年:甲子 海中金 就是金鼠年
八字年柱月柱算法有二种,此程序采用较通用的,即年柱以立春日启算,月柱以月首节气日启算。
这里有五行纳音,二十八宿,十二建的算法。程序中有注释供同好参考。
当日日历显示是选定日的各项信息,另加寒日九九,暑日三伏,入梅出梅信息。
本万年历适应用范围(1900-2100),用图形方法绘出,可加贴底图,可屏幕截图保存图片,共享图片,添加图片输出和打印输出功能。贴图的图片起个文件名放在手机根目录就会自动更换。若要编制年份跨期长的万年历,可向我索取数据资料。我有(B.C.850-3000)的daList(3000)阴历数据。另外还有精确的节气时间数据 jqdata ( 3000 ) 。
下面的代码是用简单的C语言写的,很简洁,适用于初学者。我是在安卓手机上编写的,显示是手机界面。
( 代码中print...是算法测试用,这是我的测试方法,可注释掉 )
以下是示例程序源码:
//****************************************
//* 万年历 (1900-2100) ver. 3.2.2
//* 制作人:张纯叔 micelu@126.com
//****************************************
Canvas cs;
string sBarDes[10];
int nBarId[10];
float src[4]; //ClearDraw (cls) clear screen
FileInput filebox ;
string fname; //filename
int ds[3]; //get date yymmdd
int dy,dm,dd; //年月日
int wd; //weekday
int alln,alln1; //天数
int i,k,ns,leap;
double nleap,nleapd; //农历闰月,0无闰,闰月大小
int n,n0,n1,n2 ;
string s,s0,ss ;
string s1,s2,s3,s4,s5,s6 ;
string s11, s12, s13, s14 ;
string wds,wdss; //weekday
float x0,y0,x1,y1;
float sx,sy,sx1,sy1 ; //可调整屏幕left,top输出定位
float sx2,sy2 ; //可调整屏幕left,top输出定位
int ddx, ddy ;
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; //solar
string das0,das1,das2; // 0 last yy, 1 this yy, 2 new
double ysm,ysd; //年首月,年首日
int msd[12]; //月朔日
int msd0,msd1; //月首日
int mdx ;
int chuxi ; //除夕29,30
string nlms,nlds; //农历月$,农历日$
string getms,getds, mss$ ; //for print nlm$,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; //五行 十二建 二十八宿
string tgs, dzs, whs, whs1, whs2 ; //计算五行
int dzd0,dzd1; //上年冬至日,本年冬至日
int fmn,mn,fn; //母亲节父亲节
int isdraw;
int setc; //set day color in red
string fd$ ; //输出串
string p1, p2, p3, p4, p5 ;
string mon$;
int mode ; //屏幕输出样式
int showbz ; //显示生辰八字
main(){
setTitle ("万年历 (1900-2100)");
jqnames="小寒大寒立春雨水惊蛰春分清明谷雨立夏小满芒种夏至小暑大暑立秋处暑白露秋分寒露霜降立冬小雪大雪冬至";
nlds="初一初二初三初四初五初六初七初八初九初十十一十二十三十四十五十六十七十八十九二十廿一廿二廿三廿四廿五廿六廿七廿八廿九三十初一初二初三";
wdss="星期日星期一星期二星期三星期四星期五星期六 ";
nlms="冬月腊月正月二月三月四月五月六月七月八月九月十月冬月腊月";
sxs="鼠牛虎兔龙蛇马羊猴鸡狗猪";
whss="海中金炉中火大林木路旁土剑锋金山头火洞下水城墙土白腊金杨柳木泉中水屋上土霹雷火松柏木长流水沙中金山下火平地木壁上土金箔金佛灯火天河水大驿土钗钏金桑松木大溪水沙中土天上火石榴木大海水";
g12ss="建除满平定执破危成收开闭";
st28ss="角亢氐房心尾箕斗牛女虚危室壁奎娄胃昴毕觜参井鬼柳星张翼轸";
tgs="甲乙丙丁戊己庚辛壬癸" ;
dzs="子丑寅卯辰巳午未申酉戌亥" ;
whs1="木木火火土土金金水水" ;
whs2="水土木木土火火土金金土水" ;
for (i=0; i<60; i++){ //计算干支字表,五行字表
n1=i-i/10*10 ; n2=i-i/12*12 ;
s1=subString (tgs, n1, 1) ;
s2=subString (dzs, n2, 1) ;
s3=subString (whs1, n1, 1) ;
s4=subString (whs2, n2, 1) ;
gzs=gzs+s1+s2 ;
whs=whs+s3+s4 ; }
//cs.SetBackground(250,250,250);
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]="💻";
nBarId[5]=105;
setToolBarHeight(10);
setButtonTextSize(12);
setToolBarBackgroundColor(255,240,240,240);
setButtonColor(255,250,250,250);
setButtonTextColor(255,0,0,120);
setToolBar(100,myToolBarProc,sBarDes,nBarId,6);
readDat (); //read calendar dat a 1900-2100
getDate(ds); //init Date = today
dy=ds[0] ;
dm=ds[1] ;
dd=ds[2] ;
isdraw=0;
sx=200 ; sy=200 ; //定位基点 left, top
sx1=600 ; sy1=600 ; sy2=800 ;
showVer ();
while (){}
}//main ()
showVer (){ //打印版本号
fname="/storage/emulated/0/tutu.jpg";
cs.DrawBitmap(fname,0,2); //加底图
cs.SetTextStyle (1);
cs.SetFillMode(1);
cs.SetColor(50,220,220,20);
cs.DrawRect (0,940,720,1030);
cs.SetTextSize (70);
ss="萬年历" ;
cs.SetColor(255,0,100,50);
cs.DrawText (ss, 34, 993);
cs.SetColor(255,120,250,250);
cs.DrawText (ss, 30, 990);
cs.SetFillMode(0);
cs.SetColor(255,250,190,0); //金色
cs.DrawText (ss, 30, 990);
cs.SetFillMode(1);
cs.SetTextSize (26);
s="编译人:张纯叔 (micelu@126.com) ";
cs.DrawText(s,30,1025);
cs.DrawText("Version 3.2.2",460,1025);
cs.Update ();
}//showVer ()
inputDate (){ //日期输入
string sDat[101];
getDate(ds); //getDate = today
pickDate("输入日期:",ds); //input date
clearOutput ();
dy=ds[0];
dm=ds[1];
dd=ds[2];
print "InputDate = ",dy ,"-",dm,"-",dd;
dd2=intToString(dd); //this day
getWeekday () ;
}//inputDate()
getWeekday (){//计算月首日星期几
int ty;
int tm;
ty=dy;
tm=dm;
if (dm<3){
ty=dy-1;
tm=dm+12; }
clearOutput ( ) ;
//first day=1 this month
//iWeek=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)
//mod 7 基姆拉尔森公式
alln=2*tm+3*(tm+1)/5+ty+(int)(ty/4);
alln=alln-(int)(ty/100)+(int)(ty/400)+2;
wd=alln-alln/7*7; //mod (alln,7)
wds=subString(wdss,wd*3,3);
string yds; //for 干支日 五行 28宿 12建
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/4*4)==0&&dm>2)alln1=alln1+1;
print "all days = ",alln," ",alln1;
// return weekday = wds $
}//getWeekday ()
print_bzjjff ( ){ //show 九九三伏入梅出梅
//冬至日起算,连冬起九
int jjiu,jiu1,jiu2; //print and show 九九
string jius;
jius="一二三四五六七八九";
//dzd0上年冬至日,dzd1本年冬至日
cs.SetTextSize (22);
// sx1=600 ; sy1=600 ; //调整屏幕输出定位
if (dm>11&&dd>=dzd1||dm<4){
if(dm==12&&dd>=dzd1)jjiu=dd-dzd1;
if(dm==1)jjiu=31-dzd0+dd;
if(dm==2)jjiu=31-dzd0+31+dd; if(dm==3&&dd<13)jjiu=31-dzd0+31+28+dd;
jiu2=jjiu-(int)(jjiu/9*9)+1; //mod
jiu1=(int)(jjiu/9)+1;
print "jiu1 = ",jiu1," jiu2 = ",jiu2;
s0=subString (jius,jiu1-1,1);
s=intToString (jiu2);
ss=s0+"九第 "+s+" 天 ";
if(jjiu>80)ss=" ";
print jjiu;
print ss;
if (dm==3&&dd>12)ss=" ";
cs.DrawText (ss,sx1-20,sy1-230);
} //show jiujiu$
//芒种后丙日入梅 小暑后未日出梅
cs.SetTextSize (26);
alln1=alln1+dd-1; //all days
n1=alln1+9 ;
gzd=n1-(int)(n1/60*60);
gzds=subString(gzs,gzd*2,2);
ss=" ";
if (dm==6&&dd>6&&dd<16){
s0=subString (gzds,0,1);
if (s0=="丙"){
ss="今日入梅" ;
cs.DrawText (ss,sx1-20,sy1-270); } }
if (dm==7&&dd>6&&dd<18){
s0=subString (gzds,1,1);
if (s0=="未"){
ss="今日出梅";
cs.DrawText (ss,sx1-20,sy1-270); } }
//计算三伏 ******
//夏至后第三个庚日起10天为初伏
//夏至后第四个庚日到立秋后第一个庚日为中伏
//立秋后第一个庚日起10天为末伏
int fn;
string fu1,fu2,fu3;
fu1="初伏第";
fu2="中伏第";
fu3="末伏第";
cs.SetTextSize (22);
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){ //7月
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,sx1-15,sy1-230); }
if (dm==8){ //8月
if (dd<n+10){
n0=31-n-10+dd;
if (dd<n)
{ss=fu2+intToString (n0)+"天";}
if (dd>=n){ss=fu3+intToString (n0-20)+"天";}
cs.DrawText (ss,sx1-15, sy1-230); }
} //show three fu day
}//print_bzjjff ()
show_BZ ( ){ //显示八字五行
//八字五行十二建二十八宿
s=" " ; ss=" " ;
// sy2=800 调整屏幕left,top输出定位
cs.SetTextSize (20);
//calculate GZ,gzy,gzm,gzd
print "节气日 : ",jqd1;
alln1=alln1+dd-1; //all days
n=(dy+2096);
if(dm<2)n=n-1;
if(dm==2&&dd<jqd1)n=n-1;
gzy=n-(int)(n/60*60);
s1=subString(gzs,gzy*2,2);
if(dd<jqd1){mz=1;}else{mz=0;}
gzn1=(dy+2096)*12+dm-mz;
gzm=gzn1-(int)(gzn1/60*60);
s2=subString (gzs,gzm*2,2);
n1=alln1+9;
gzd=n1-(int)(n1/60*60);
s3=subString(gzs,gzd*2,2);
gzds=s3 ;
gzh=(gzd-(int)(gzd/5*5))*12;
s4=subString(gzs,gzh*2,2);
cs.SetColor(255,250,0,0);
dd2=intToString(dd); //this day $
if(len(dd2)==1)dd2="0"+dd2;
cs.SetTextSize (22);
bzs="八字:"+s1+" "+s2+" "+s3+" "+s4 ;
cs.DrawText(bzs,40,sy2-30);
print "八字 :" +bzs ;
string wh ;
s11=subString(whs,gzy*2,2);
s12=subString (whs,gzm*2,2);
s13=subString (whs,gzd*2,2);
s14=subString (whs,gzh*2,2);
wh=s11+" "+s12+" "+s13+" "+s14 ;
wh="五行:"+wh ;
cs.DrawText(wh,40,sy2); //output
x0=400;
y0=sy2; //可调整屏幕left,top输出定位
cs.SetTextSize(22);
s="起时 : ";
cs.DrawText(s,400,y0-30);
s="23 - 1 11 - 13";
cs.DrawText(s,400,y0-5);
s=" 1 - 3 13 - 15";
cs.DrawText(s,400,y0+20);
s=" 3 - 5 15 - 17";
cs.DrawText(s,400,y0+45);
s=" 5 - 7 17 - 19";
cs.DrawText(s,400,y0+70);
s=" 7 - 9 19 - 21";
cs.DrawText(s,400,y0+95);
s=" 9 - 11 21 - 23";
cs.DrawText(s,400,y0+120);
for(i=0;i<6;i++){
s5=subString(gzs,(gzh+i)*2,2);
s6=subString(gzs,(gzh+6+i)*2,2);
s=s5+" "+s6;
cs.DrawText(s,470,y0-5+i*25); }
string wh1, wh2 ;
n=gzh ;
// cs.SetTextSize (20);
for(i=n ; i<n+6; i++){
whs1=subString (whs, i*2, 2) ;
whs2=subString (whs, (i+6)*2, 2) ;
wh1=wh1+whs1+" " ;
wh2=wh2+whs2+" " ; }
wh1="23 - 11 "+wh1 ;
wh2="11 - 23 "+wh2 ;
cs.DrawText (wh1,x0-83,y0+150) ;
cs.DrawText (wh2,x0-83,y0+170) ;
x0=40; y0=sy2+30;
s11=subString (whss,(gzy/2)*3,3);
s12=subString (whss,(gzm/2)*3,3);
s13=subString (whss,(gzd/2)*3,3);
s14=subString (whss,(gzh/2)*3,3);
s="年 : "+s1+s11; //show 五行
cs.DrawText (s,x0,y0+5);
s="月 : "+s2+s12;
cs.DrawText (s,x0,y0+30);
s="日 : "+s3+s13 ;
cs.DrawText (s,x0,y0+55);
s="时 : "+s4+s14;
cs.DrawText (s,x0,y0+80);
n=alln1+3; //print 28stars
n1=n-n/28*28;
s5=subString (st28ss,n1,1);
n=alln1-(dy-1900)*12-dm+10; //show 12建日
if (dd>=jqd1)n=n-1;
n1=n-n/12*12;
s6=s5+subString(g12ss,n1,1);
cs.DrawText (s6,x0+143, y0+55);
setDisplay (1);
cs.Update ();
}//show_BZ
calnlds(){ //计算农历要素
//calculate 农历月$ getms 农历日$ getds*******
//double nleap,nleapd; //农历闰月,0无闰,闰月大小
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);
if (s=="a") s="10" ;
nleap=stringToDouble (s);
n=(int)(nleap);
s=subString(das1,12,1);
nleapd=stringToDouble (s);
print " nleap = ", n," nleapd = ",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);}
if (dy==1919) ss="11010010011011" ;
if (dy==1984) ss="11101100100101" ;
if (dy==2052) ss="11010010010111" ;
das2=ss;
print "new das2 = ",das2;
print " ";
//**** calculate msd(12) // 年 月朔日$
n0=(int)(ysd); //年首日起算
if (dy-(int)(dy/4)*4==0){leap=1;}else{leap=0;}
//print "leap = ",leap;
if (ysm==1){
s=subString(das2,1,1);
if (s=="1"){n=30;}else{n=29;}
msd[1]=n0;
msd[2]=msd[1]+n-31; }
if (ysm==2){
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;}
if(n0<=1)n0=n+n0;
if(n0>30)n0=n0-30 ;
msd1=n0;
print "月朔日msd1: ", msd1 ;
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 = "+getds; //农历日$
//农历月名$ ******** 1919 1984 2052 rn=2-1
n1=(int)(nleap); //2017 nleap n1=6;
if(ysm==2){
getms=subString(nlms,dm*2,2);
mss$=subString(nlms,dm*2-2, 2);
mdx=dm ;
if (msd1>22){ // 22-02-01 正月初一
getms=subString(nlms,dm*2+2,2);
mss$=subString(nlms,dm*2, 2);
mdx=dm+1 ; }
} //正月为 2 月份
if(ysm==1){ //正月为 1 月份
if(dm<n1+1){
getms=subString(nlms,dm*2+2,2);
mss$=subString(nlms,dm*2, 2);
mdx=dm ; }
if(dm==n1+1){
getms="闰"+subString(nlms,dm*2,2);
mss$=subString(nlms,dm*2,2);
mdx=dm+1 ; }
if(dm>n1+1){
getms=subString(nlms,dm*2,2);
mss$="闰"+subString(nlms,dm*2-2,2);
mdx=dm ; }
if(dm>n1+2){
getms=subString(nlms,dm*2,2);
mss$=subString(nlms,dm*2-2, 2);
mdx=dm ; }
}
//y1984 闰10小, y1919 r17 闰7大, y2052闰8小
if(dy==1919||dy==1984||dy==2052){
if(dm<n1+1){ //正月为 2 月份
k=0 ; if (dm>4) k=2 ;
getms=subString(nlms,dm*2+k,2);
mss$=subString(nlms,dm*2, 2);
mdx=dm ;
if (k==2) mdx=dm+1 ; }
if(dm==n1+1){
getms="闰"+subString(nlms,dm*2,2);
mss$=subString(nlms,dm*2,2);
mdx=dm+1 ; }
if(dm>n1+1){
getms=subString(nlms,dm*2,2);
mss$="闰"+subString(nlms,dm*2-2,2);
mdx=dm ; }
if(dm>n1+2){
getms=subString(nlms,dm*2,2);
mss$=subString(nlms,dm*2-2, 2);
mdx=dm ; }
}
if(dy==2052&&dm==4) {
getms=subString(nlms,dm*2+2,2);
mdx=dm+1 ; }
s1=getms ; //print " 月"
if(s1=="冬月")s1="十一月";
if(s1=="腊月")s1="十二月";
getms=s1 ;
s1=mss$; //print " 月"
if(s1=="冬月")s1="十一月";
if(s1=="腊月")s1="十二月";
mss$=s1 ; //替换
s3=subString(das2,mdx ,1);
if (dy==1984){ s3=subString (das2, dm+1, 1) ; }
if(s3=="1"){s3="大"; chuxi=0; }
else{s3="小"; chuxi=1; }
print "本月 getms = ", getms+" "+s3;
print "上月 mss$ = ", mss$ ;
print "月份 = ",dm," , 农历月 = ",getms+s3;
}//calnlds ()
calendar (){ //屏幕打印日历
//calculate and show calendar ************
calnlds(); //取得农历日$ getms, getds
cs.ClearDraw (0,src);
showVer () ; //加底图,版本
isdraw=0;
//此定位方法sx,sy可调整打印输出位置
//set 定位基点 left=200, top=200
cs.SetTextStyle (1); //粗体
cs.SetStrokeWidth (1);
s=intToString (dm); //print big dm
if (dm<10){x1=sx-10;}else{x1=sx-100;}
cs.SetFillMode (1);//0不填色,1填色
cs.SetTextSize (300); //print big dm
cs.SetColor (80,0,160,0);
cs.DrawText (s, x1,sy+290);
cs.SetFillMode (0);//0不填色,1填色
cs.SetTextSize (300); //print big dm
cs.SetColor (200,250,100,0);
cs.DrawText (s, x1, sy+290);
cs.SetFillMode (1);//0不填色,1填色
cs.SetTextSize (19);
cs.SetColor (255,255,0,0);
s="星期日";
cs.DrawText (s,sx-167,sy-70);
s="星期六";
cs.DrawText (s,sx+252 ,sy-70);
cs.SetColor(255,0,0,240);
s="星期一 星期二 星期三 星期四 星期五”;
cs.DrawText (s,sx-94, sy-70);
cs.DrawLine(sx-190,sy-100,sx+340,sy-100);
cs.DrawLine(sx-190,sy-50,sx+340,sy-50);
cs.DrawLine(10,sy+460,690,sy+460);
cs.SetTextSize (66); //print yymm
s=intToString (dy)+" · ";
leap=0;
n=0;
if (dm<10)n=20;
s1=intToString (dm);
cs.SetColor(250,0,100,0);
cs.DrawText (s+s1,sx+50+n+4,sy-120+3);
cs.SetColor(255,0,0,240);
cs.DrawText (s+s1,sx+50+n,sy-120);
cs.SetFillMode (0);//0不填色,1填色
cs.SetColor(255,250,160,0);
cs.DrawText (s+s1,sx+50+n,sy-120); //print yymm
cs.SetColor(255,0,0,250);
cs.SetFillMode (1);//0不填色,1填色
//**** calculate solarterm //show 节气
dy2=intToString(dy); //show 节气
dm2=intToString(dm);
dy1=stringToDouble(dy2);
dm1=stringToDouble(dm2);
cs.SetTextSize (28);
dy0=dy1;
n=dm*2-1;
caljq(); //节气计算
jqd1=(int)(dd1);
jqs1=subString(jname2,0,2);
cs.DrawText (jname2,sx-160,sy+495);
jqss1=jname2;
n=dm*2;
caljq (); //节气计算
jqd2=(int)(dd1);
jqs2=subString(jname2,0,2);
cs.DrawText(jname2,sx-160,sy+530);
jqss2=jname2;
if (dm==12)dzd1=jqd2; //九九,连冬起九
print "本年冬至:”,dzd1;
if (dm<4){
n=24;
dy0=dy1-1;
caljq ();
dzd0=(int)(dd1);
print "上年冬至:”,dzd0; }
//***** print 干支年 生肖
cs.SetColor(255,0,0,250);
if(ysm==2&&dm==1){n=dy-4-1;}else{n=dy-4;}
gzn=(n-n/60*60);
ggzs=subString(gzs,gzn*2,2);
s1=getms+s3;
s=ggzs+"年"+s1 ; //年干支
sxn=gzn-gzn/12*12; //生肖
gsxs=subString(sxs,sxn,1);
ggzs=s+"("+gsxs+")";
cs.SetTextSize (26); //干支年月生肖
cs.DrawText(ggzs,sx-170, sy-120);
string nss ; //计算是月天数
double dns ;
nss="00312831303130313130313031" ;
s=subString (nss, dm*2, 2 ) ;
dns=stringToDouble (s) ;
ns=(int)(dns) ;
if (dy/4*4==dy)leap=1;
if (dm==2&&leap==1)ns=29 ;
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";
cs.SetTextSize (36);
cs.DrawText (s,sx1-60,sy1-550);
cs.SetColor (255,0,0,240);
if(dm==1)ns=32; //ns=mT+1
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;
//台历式月历定位打印输出较为复杂,
//下面介绍一种算法,
//输出为 6行 7列,sx,sy调整屏幕输出定位
//x1, y1 调整打印坐标,x0=列 , y0=行
fmn=0; k=dd ; s=" " ; //打印月历
for (i=1;i<ns;i++){//print a.d. print get ms ds $
cs.SetColor (255,0,0,240);
cs.SetTextSize (30);
n=0; setc=0;
x0=(i+wd-1)-((i+wd-1)/7*7); //mod (sx,7)
y0=(i+wd-1)/7;
if (x0==0||x0==6)cs.SetColor(255,255,0,0);
if (i==1&&dy>1948){ //设置节日红色显示
if (dm==1||dm==5||dm==6||dm==7||dm==8||dm==10){cs.SetColor(255,255,0,0);}
}
if(dm==ysm&&i==ysd-1)cs.SetColor (255,255,0,0);
if(dm==ysm&&i==ysd)cs.SetColor (255,255,0,0);
if (x0==0)fmn=fmn+1; //父亲节母亲节第几周
if (dm==5&&fmn==2&&x0==0)mn=i;
if (dm==6&&fmn==3&&x0==0)fn=i;
//for father mather festival
x1=x0*70+114+sx-200; //调整打印坐标
y1=y0*80+300+sy-300 ;
s0=intToString(i);
n=0;
if (len(s0)==1)n=10;
cs.DrawText (s0,x1+n-70, 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 " m月"
if (ysm==2&&msd1==1&& i>29){
//****y1984-5 y2024-12
s=subString (nlms,dm*2+2,2); }
if(s=="冬月")s="十一月";
if(s=="腊月")s="十二月"; }
//**** show festival ***************
//**** output solarterm on table
if(i==jqd1)s=jqs1;
if(i==jqd2)s=jqs2;
if(dm==1&&i==1) s="元旦节";
if(dm==ysm&&i==ysd-1)s="除夕";
if(dm==ysm&&i==ysd)s="春节";
if (dy>1948){
if(dm==2&&i==14)s="情人节";
if(dm==3&&i==8)s="妇女节";
if(dm==3&&i==12)s="植树节";
if(dm==5&&i==1)s="劳动节";
if(dm==5&&i==4)s="青年节";
if(dm==5&&i==mn)s="母亲节";
if(dm==6&&i==fn)s="父亲节";
if(dm==6&&i==1)s="儿童节";
if(dm==7&&i==1)s="建党节";
if(dm==8&&i==1)s="建军节";
if(dm==9&&i==10)s="教师节";
if(dm==10&&i==1) s="国庆节";
}
if(dm==12&&i==25) s="圣诞节";
if(getms=="二月"&&s2=="十五"&& i<msd1){s="元宵节";setc=12;}
if(getms=="正月"&&s2=="十五"&& i>msd1){s="元宵节";setc=12;}
if(getms=="三月"&&s2=="初二"&& i<msd1)s="龙抬头";
if(getms=="二月"&&s2=="初二"&& i>msd1)s="龙抬头";
if(getms=="六月"&&s2=="初五"&& i<msd1){s="端'午节"; setc=12;}
if(getms=="五月"&&s2=="初五"&& i>msd1){s="端午节"; setc=12;}
if(getms=="八月"&&s2=="初七"&&i<msd1)s="七夕节";
if(getms=="七月"&&s2=="初七"&&i>msd1)s="七夕节";
if(getms=="八月"&&s2=="十五"&&i<msd1)s="中元节";
if(getms=="七月"&&s2=="十五"&&i>msd1)s="中元节";
if(getms=="九月"&&s2=="十五"&&i<msd1){s="中秋节"; setc=12; s6=s ; }
s6="" ;
if(getms=="八月"&&s2=="十五"&& i>msd1){s="中秋节"; setc=12; s6=s ; }
if(dm==10&&i==1){ s="国庆节"; }
if(getms=="十月"&&s2=="初九"&& i<msd1){s="重阳节"; setc=12;}
if(getms=="九月"&&s2=="初九"&& i>msd1){s="重阳节";setc=12;}
if(getms=="正月"&&s2=="初八"&&i<msd1)s="腊八节";
if(getms=="十二月"&&s2=="初八"&&i>msd1)s="腊八节";
if(getms=="正月"&&s2=="廿三"&& i<msd1)s="小年";
if(getms=="十二月"&&s2=="廿三"&& i>msd1)s="小年";
if (i==(msd1-1)&&chuxi==1&&s1=="十二月"&&s2=="廿九"&&dm<2)s="除夕";
if (setc==12)cs.SetColor (255,255,0,0);
if (len(s)==3)n=10;
cs.DrawText(s,x1-2-n-70, y1+30); //print ch
if (dd==i) fd$=s ; //get fd day ****
if(dd==i){ //draw today mark ****
cs.SetFillMode (0) ;
cs.SetColor (255,250,0,0);
cs.DrawRect (x1-80,y1-30,x1-25,y1+10);
cs.SetFillMode (1) ;
cs.SetColor (100,250,250,20);
cs.DrawRect (x1-80,y1-30,x1-25,y1+10); }
} //print a.d. dd$ festival
//print today dig dd $ *************
n0=wd+dd-1 ;
n1=n0-n0/7*7 ;
wds=subString(wdss,n1*3,3);
//sx1=600, sy1=600 调整屏幕输出定位
cs.SetColor(50,220,220,20); //big dd back
cs.DrawRect (sx1-60,sy1-550,sx1+116,sy1-210);
s=intToString (dd) ;
if (dd<10) { n=45 ; }else{ n=0 ; }
cs.SetColor (255,0,100,0);
cs.SetTextSize (120);
cs.DrawText(s, sx1-45+n, sy1-441 );
if (n1==0||n1==6) { cs.SetColor (255,255,0,0); }
else { cs.SetColor (255,0,0,240); }
cs.DrawText(s, sx1-50+n, sy1-445 );
cs.SetTextSize (28);
cs.DrawText(wds , sx1-10, sy1-365 );
cs.SetFillMode (0);//0不填色,1填色
if (n1==0||n1==6) { cs.SetColor (255,250,250,0); }
else { cs.SetColor (255,250,160,0); }
cs.SetTextSize (120);
cs.DrawText(s, sx1-50+n, sy1-445 );
cs.SetTextSize (28);
cs.DrawText(wds , sx1-10, sy1-365 );
cs.SetFillMode (1); //0不填色,1填
if (n1==0||n1==6) { cs.SetColor (255,250,0,0); }
else { cs.SetColor (255,0,0,240); }
cs.SetTextSize (26);
s1=getds ;
s2=subString (s1 , dd*2-2, 2) ;
ss=getms ; //本月
if (msd1==1&& dd>30){ //y1984-5-31月尾初日
ss=subString (nlms,dm*2+2,2); }
if (dd<msd1) ss=mss$ ; //上月
if(ss=="冬月")ss="十一月";
if(ss=="腊月")ss="十二月";
ss=ss+s2 ; //ch: yy-mm
n=len(ss) ;
cs.DrawText(ss , sx1+20-n*10, sy1-405 );
cs.SetColor (255,250,0,240) ;
if (dd==jqd1) {
ss="今日"+jqs1 ;
cs.DrawText(ss , sx1-20, sy1-280 ); }
if (dd==jqd2) {
ss="今日"+jqs2 ;
cs.DrawText(ss , sx1-20, sy1-280 ); }
cs.SetTextSize (30);
if (fd$==jqs1||fd$==jqs2) fd$=" " ;
s4=subString (fd$, 0, 1) ;
if (s4=="初"||s4=="十"||s4=="廿"||s4=="二"||s4=="三"){
fd$=" " ; }
s4=subString (fd$, 1, 1) ;
s5=subString (fd$, 2, 1) ;
if (s4=="月"||s5=="月") fd$=" " ; //只显示节日
fd$=fd$+s6 ;
n=len(fd$) ; s6=" " ; //节日
cs.DrawText(fd$ , sx1+21-n*11.2, sy1-320 );
//**** print 九九,梅天,伏天
print_bzjjff ( ) ;
setDisplay (1);
cs.Update ();
}//calendar () ***********************
myToolBarProc(int nBtn,int nContext){
if(nBtn==100){//输入日期,计算星期, 显示月历
inputDate () ;
calendar();
}
if(nBtn==101){//上一月
dm=dm-1 ;
if (dm<1) { dy=dy-1 ; dm=12 ; }
if (dm==2&&dd>28){ dd=28 ; }
if (dd>30){ dd=30 ; }
getWeekday ();
calendar () ;
}
if(nBtn==102){//下一月
dm=dm+1 ;
if (dm>12) { dy=dy+1 ; dm=1; }
if (dm==2&&dd>28){ dd=28 ; }
if (dd>30){ dd=30 ; }
getWeekday ();
calendar () ;
}
if(nBtn==103){//生辰八字
getWeekday ();
show_BZ ( ) ; //显示八字五行
}
if(nBtn==104){//退出程序
clearOutput();
cs.ClearDraw (0,src);
setDisplay (0);
exit (0);
}
if(nBtn==105){//watch
mode=mode+1 ;
if (mode>3) mode=0 ;
if (mode==0) {
sx=200 ; sy=200 ; sx1=600 ; sy1=610 ; }
if (mode==1) {
sx=350 ; sy=200 ; sx1=70 ; sy1=610 ; }
if (mode==2) {
sx=200 ; sy=400 ; sx1=600 ; sy1=1070 ; }
if (mode==3) {
sx=350 ; sy=400 ; sx1=70 ; sy1=1070 ; }
if (mode>1) { sy2=60 ; }else{ sy2=815 ; }
getWeekday ();
calendar( ) ;
// setDisplay (0); //调试查看
}
}//Toolbar () ***********************
caljq(){//calculate solar ** return jname2
juD=dy0*(365.2423112-0.000000000000064
*(dy0-100)*(dy0-100)- 0.00000003047
*(dy0-100))+15.218427*n+1721050.71301;
tht=0.0003*dy0-0.372781384-0.2617913325*n;
yrD=(1.945*sin(tht)-0.01206*sin(2*tht))
*(1.048994-0.00002583 *dy0);
sD=-0.0018*sin(2.313908653*dy0
-0.439822951-3.0443*n);
//'vs = juD '** 平气
vs = (juD + yrD + sD); // '** 定气
dalt=-15+(juD-2382148)*(juD-2382148)/41048480;
dalt = dalt/86400;
//print dalt;
jd = vs - 0.5 - dalt-0.025; // + 0.008;
int gg;
gg=n-(int)(n/2*2);
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.25*c);
e=(int)((b-d)/30.6001);
dd1=b-d-(int)(30.6001*e);
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(n==24)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-hh1*3600)/60);
ss1=(int)(allss-hh1*3600-mm1*60);
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;
//return 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;
}
//*** End ***