热度 17
2012-2-20 22:10
1039 次阅读|
0 个评论
这是再次改进后的引擎代码,现在可以识别一些简单的布局陷阱,但是还有不足,等以后添加上检测活三的模块后,可以变得更强!期待中,有改进意见只管说出来,大家一起交流! public void danao9(int x,int y) { int luozix=0; int luoziy=0; int jishu1=0; int jishu2=0; int hei*****shu=4; int bai*****shu=-1; int counter1=0; int counter2=0; int xunhuanx=0; int xunhuany=0; int chuanrux=0; int chuanruy=0; int locationx=0; int locationy=0; int weizix=0; int weiziy=0; chuanrux=x/20; chuanruy=y/20; int jifen ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; int dingweiy ={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; for(xunhuanx=chuanrux-2;xunhuanxchuanrux+3;xunhuanx++) for(xunhuany=chuanruy-2;xunhuanychuanruy+3;xunhuany++) { if(xunhuanx==chuanruxxunhuany==chuanruy) { dingwei =1000; } else { if(xunhuanx0||xunhuanx24||xunhuany0||xunhuany24) { dingwei =1000; } else { dingweix =xunhuanx; dingweiy =xunhuany; } } jishu1++; } for(jishu2=0;jishu225;jishu2++) { weizix=dingweix ; weiziy=dingweiy ; if(dingwei ==1000) { continue; } else { if((bodyArray ==1)||(bodyArray ==-1)) { jifen +=-100; } else { } } } for(jishu2=0;jishu225;jishu2++) { weizix=dingweix ; weiziy=dingweiy ; if(jishu2!=13) { if(chuanrux==weizix||chuanruy==weiziy) { jifen +=hei*****shu; } else { if((chuanrux-weizix)==(chuanruy-weiziy)) { jifen +=hei*****shu; } else { } } } if(dingwei ==1000) { continue; } else { for(counter1=0;counter125;counter1++) { locationx=dingweix ; locationy=dingweiy ; if(locationx==weizixlocationy==weiziy) { continue; } else { if(locationx==weizix||locationy==weiziy) { if(bodyArray ==1) { jifen +=hei*****shu; } else { if(bodyArray ==-1) { jifen +=bai*****shu; } else { } } } else { if((locationx-weizix)==(locationy-weiziy)) { if(bodyArray ==1) jifen +=hei*****shu; else { if(bodyArray ==-1) { jifen +=bai*****shu; } else { } } } else { } } } } } } int zuida=0; for(counter2=0;counter225;counter2++) { if(jifen zuida) { zuida=jifen ; } else { continue; } } for(counter2=0;counter225;counter2++) { if(jifen ==zuida) { luozix=dingweix *20; luoziy=dingweiy *20; } else { } } setDown2(luozix,luoziy); }