诘屈聱牙之javascript中国象棋
2007-04-07 00:00
309 查看
IE6.0 Only
非XHTML标准,可能IE 7.0也看不了....哈哈
蓝方先走
* { font:24px arial, "宋体"; font-weight:bold; color:white; cursor:default; }
table { table-layout:fixed; border-collapse:collapse; position:absolute; left:50px; top:50px; }
td { width:80px; height:80px; border:1px solid silver; color:black; text-align:center; line-height:80px; }
img.i1 { width:78px; height:78px; }
img.i2 { width:49px; height:49px; }
img.i3 { width:25px; height:49px; }
.chessman_red { background:url(/attachments/2007/3/29/20070329_2187cc5e9def581951f2v22EfdUSXQ7J.jpg); width:50px; height:50px; line-height:50px; text-align:center; }
.chessman_blue { background:url(/attachments/2007/3/29/20070329_5caa80c54f776b93bd582BwraVRWXf43.jpg); width:50px; height:50px; line-height:50px; text-align:center; }
var tb;
var cch=new Array();
var his=new Array();
var players=["red","blue"];
var curPlayer=1;
window.onload=function(){
document.onselectstart=function(){ return(false); }
document.onclick=do_click;
document.oncontextmenu=do_context;
tb=document.createElement("table");
document.body.appendChild(tb);
for(var i=0;ithis.y?y:this.y;
for(var i=mi+1;ithis.x?this.x:x;
ma=x>this.x?x:this.x;
for(var i=mi+1;i4)return(false);
if(cch[(this.y+y)/2*9+(this.x+x)/2])return(false);
break;
case "象":
if(Math.abs(this.x-x)!=2||Math.abs(this.y-y)!=2||y4){
if(y-this.y!=-1)return(false);
}else{
if(!((y-this.y==-1&&x==this.x)||(y==this.y&&Math.abs(this.x-x)==1)))return(false);
}
break;
//}else{
if(ythis.y?this.y:y;
ma=y>this.y?y:this.y;
for(var i=mi+1;ithis.x?this.x:x;
ma=x>this.x?x:this.x;
for(var i=mi+1;ithis.y?this.y:y;
ma=y>this.y?y:this.y;
for(var i=mi+1;ithis.x?this.x:x;
ma=x>this.x?x:this.x;
for(var i=mi+1;i
非XHTML标准,可能IE 7.0也看不了....哈哈
蓝方先走
* { font:24px arial, "宋体"; font-weight:bold; color:white; cursor:default; }
table { table-layout:fixed; border-collapse:collapse; position:absolute; left:50px; top:50px; }
td { width:80px; height:80px; border:1px solid silver; color:black; text-align:center; line-height:80px; }
img.i1 { width:78px; height:78px; }
img.i2 { width:49px; height:49px; }
img.i3 { width:25px; height:49px; }
.chessman_red { background:url(/attachments/2007/3/29/20070329_2187cc5e9def581951f2v22EfdUSXQ7J.jpg); width:50px; height:50px; line-height:50px; text-align:center; }
.chessman_blue { background:url(/attachments/2007/3/29/20070329_5caa80c54f776b93bd582BwraVRWXf43.jpg); width:50px; height:50px; line-height:50px; text-align:center; }
var tb;
var cch=new Array();
var his=new Array();
var players=["red","blue"];
var curPlayer=1;
window.onload=function(){
document.onselectstart=function(){ return(false); }
document.onclick=do_click;
document.oncontextmenu=do_context;
tb=document.createElement("table");
document.body.appendChild(tb);
for(var i=0;ithis.y?y:this.y;
for(var i=mi+1;ithis.x?this.x:x;
ma=x>this.x?x:this.x;
for(var i=mi+1;i4)return(false);
if(cch[(this.y+y)/2*9+(this.x+x)/2])return(false);
break;
case "象":
if(Math.abs(this.x-x)!=2||Math.abs(this.y-y)!=2||y4){
if(y-this.y!=-1)return(false);
}else{
if(!((y-this.y==-1&&x==this.x)||(y==this.y&&Math.abs(this.x-x)==1)))return(false);
}
break;
//}else{
if(ythis.y?this.y:y;
ma=y>this.y?y:this.y;
for(var i=mi+1;ithis.x?this.x:x;
ma=x>this.x?x:this.x;
for(var i=mi+1;ithis.y?this.y:y;
ma=y>this.y?y:this.y;
for(var i=mi+1;ithis.x?this.x:x;
ma=x>this.x?x:this.x;
for(var i=mi+1;i
相关文章推荐
- 诘屈聱牙之javascript中国象棋
- javascript实现的中国象棋单机双人
- [JavaScript] CocosCreator 中国象棋 —— 棋子移动
- JavaScript中国象棋程序(6) - 克服水平线效应、检查重复局面
- JavaScript中国象棋程序(7) - 置换表
- javascript实现的中国象棋单机双人
- JavaScript中国象棋程序(2) - 校验棋子走法
- JavaScript中国象棋程序(4) - 极大极小搜索算法
- JavaScript中国象棋程序(8) - 进一步优化
- JavaScript中国象棋程序(0) - 前言
- JavaScript中国象棋程序(3) - 电脑自动走棋
- JavaScript中国象棋程序(1) - 界面设计
- JavaScript中国象棋程序(5) - Alpha-Beta搜索
- 中国象棋将帅问题
- bzoj 1801: [Ahoi2009] chess 中国象棋
- 编程之美笔记--第一章游戏之乐--1.2中国象棋将帅问题
- [编程之美] PSet1.2 中国象棋将帅问题
- 中国象棋android源码分析
- 《编程之美》读书笔记(一):中国象棋将帅问题
- BZOJ 1801 中国象棋(DP)