中国象棋js代码,仅演示,未能真下
www.jb51.net 中国象棋 我们
var st="";
var qipuid=new Array();
var qipux=new Array();
var qipuy=new Array();
var qipuc=0;
qipust="27,8,5,2,3,3,";
qipust+="24,8,7,1,1,2,";
qipust+="29,6,3,15,5,7,";
qipust+="18,8,3,8,3,7,";
qipust+="26,6,2,8,5,8";
qipusz=qipust.split(",");
for (var x=0,qx=0;x●
"
st+="
"+qizhiname+"
"
}
function hengxian(qizhix)
{
qizhix=qizhix*50+25;
st+="
"
}
function shuxian(qizhix)
{
qizhix=qizhix*50+25;
st+="
"
}
function point(x,y)
{
var x,y;
st+="
"
}
function linehengc(top,left)
{
var top,left;
top=50*top+20;
left=50*left+15;
for(var y=0;y=qipuid.length)
{
alert("现在封盘,下次再继续")
return
}
qizhimove(qipuid[qipuc],qipux[qipuc],qipuy[qipuc])
qipuc++;
}
function qizhimove(id,x2,y2)
{
var id,x,y,x2,y2;
x2=x2*50;
y2=y2*50;
luozhi=false;
eval("x1=document.getElementById('a"+id+"').style.top");
re=/px/i;
x1= x1.replace(re, "");
eval("y1=document.getElementById('a"+id+"').style.left");
re=/px/i;
y1= y1.replace(re, "");
qizhimoveloop(id,x1*1,y1*1,x2,y2);
}
function qizhimoveloop(id,x,y,x2,y2)
{
var id,x,y;
eval("document.getElementById('a"+id+"').style.top='"+x+"px'");
eval("document.getElementById('b"+id+"').style.top='"+(x+10)+"px'");
eval("document.getElementById('a"+id+"').style.left='"+y+"px'");
eval("document.getElementById('b"+id+"').style.left='"+(y+10)+"px'");
if(x!=x2)
{
if (x>x2) x-=2;
if (xy2) y-=2;
if (y
"
}
function start()
{
for(var x=1;x
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]