超级大笨狼中国象棋(js+xml)

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
 <STYLE>
  v/:* { Behavior: url(#default#VML) }
  body {
   background-color:DarkGoldenrod;
   margin-left: 10px;
   margin-top: 10px; 
   
  }
 </STYLE>
 <title>超级大笨狼象棋</title>
</head>
<body onselectstart="document.selection.clear();" οnclick="target();" οncοntextmenu="selectNull();return(false);">
 <v:group style="top:0;left:0;width:400px;height:450px;position:relative;" CoordOrig="0,0" CoordSize="400,450">
 <v:Rect id=qiPan style="position:relative;width:460;height:510px;top=-30;left=-30;Z-INDEX:1;" fillColor="#f0e68c" StrokeWeight="2">
  <v:TextBox inset="80pt,180pt,1pt,1pt" style="Z-INDEX:2;font-size=24;font-weight:bold;position:relative;letter-spacing: 2em;color='#CC9933';FILTER: glow(color=#ffffff,strength=1) alpha(opacity=90);cursor:default;"> 楚河汉界</v:TextBox >
  <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
 </v:Rect>
  
   <v:line from="0,0" to="400,0" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,50" to="400,50" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,100" to="400,100" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,150" to="400,150" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,200" to="400,200" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,250" to="400,250" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,300" to="400,300" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,350" to="400,350" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,400" to="400,400" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,450" to="400,450" style="Z-INDEX:3;FILTER: " strokeweight="1pt"  > </v:line>
    
   <v:line from="0,0" to="0,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
   <v:line from="400,0" to="400,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="0,0" to="0,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="50,0" to="50,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="100,0" to="100,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="150,0" to="150,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="200,0" to="200,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="250,0" to="250,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="300,0" to="300,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="350,0" to="350,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="400,0" to="400,200" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="0,250" to="0,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="50,250" to="50,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="100,250" to="100,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="150,250" to="150,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="200,250" to="200,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="250,250" to="250,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="300,250" to="300,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="350,250" to="350,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
   <v:line from="400,250" to="400,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
    
     <v:line from="150,0" to="250,100" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
     <v:line from="250,0" to="150,100" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
     <v:line from="150,350" to="250,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>
     <v:line from="250,350" to="150,450" style="Z-INDEX:3;" strokeweight="1pt">  </v:line>

    
    <v:line from="55,105" to="55,110" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="55,105" to="60,105" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="55,95" to="55,90" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="55,95" to="60,95" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="45,105" to="45,110" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="45,105" to="40,105" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="45,95" to="45,90" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="45,95" to="40,95" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="355,105" to="355,110" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="355,105" to="360,105" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="355,95" to="355,90" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="355,95" to="360,95" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="345,105" to="345,110" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="345,105" to="340,105" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="345,95" to="345,90" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="345,95" to="340,95" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="55,355" to="55,360" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="55,355" to="60,355" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="55,345" to="55,340" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="55,345" to="60,345" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="45,355" to="45,360" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="45,355" to="40,355" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="45,345" to="45,340" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="45,345" to="40,345" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="355,355" to="355,360" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="355,355" to="360,355" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="355,345" to="355,340" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="355,345" to="360,345" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="345,355" to="345,360" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="345,355" to="340,355" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="345,345" to="345,340" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="345,345" to="340,345" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="105,155" to="105,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="105,155" to="110,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="105,145" to="105,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="105,145" to="110,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="95,155" to="95,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="95,155" to="90,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="95,145" to="95,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="95,145" to="90,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="205,155" to="205,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="205,155" to="210,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="205,145" to="205,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="205,145" to="210,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="195,155" to="195,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="195,155" to="190,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="195,145" to="195,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="195,145" to="190,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="305,155" to="305,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="305,155" to="310,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="305,145" to="305,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="305,145" to="310,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="295,155" to="295,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="295,155" to="290,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="295,145" to="295,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="295,145" to="290,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="105,305" to="105,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="105,305" to="110,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="105,295" to="105,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="105,295" to="110,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="95,305" to="95,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="95,305" to="90,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="95,295" to="95,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="95,295" to="90,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="205,305" to="205,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="205,305" to="210,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="205,295" to="205,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="205,295" to="210,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="195,305" to="195,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="195,305" to="190,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="195,295" to="195,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="195,295" to="190,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="305,305" to="305,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="305,305" to="310,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="305,295" to="305,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="305,295" to="310,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="295,305" to="295,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="295,305" to="290,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="295,295" to="295,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="295,295" to="290,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="395,155" to="395,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="395,155" to="390,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="395,145" to="395,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="395,145" to="390,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="395,305" to="395,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="395,305" to="390,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="395,295" to="395,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="395,295" to="390,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
   
    <v:line from="5,155" to="5,160" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="5,155" to="10,155" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="5,145" to="5,140" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="5,145" to="10,145" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:line from="5,305" to="5,310" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="5,305" to="10,305" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="5,295" to="5,290" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>
    <v:line from="5,295" to="10,295" style="Z-INDEX:3;" strokeweight="1pt"  > </v:line>  
   
    <v:oval id="q1" style="left:-20;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q1">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">车</v:TextBox >
    </v:oval>
 
    <v:oval id="q2" style="left:30;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q2">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">马</v:TextBox >
    </v:oval>
 
    <v:oval id="q3" style="left:80;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q3">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">象</v:TextBox >
    </v:oval>
 
    <v:oval id="q4" style="left:130;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q4">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">士</v:TextBox >
    </v:oval>
 
    <v:oval id="q5" style="left:180;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q5">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">将</v:TextBox >
    </v:oval>
 
    <v:oval id="q6" style="left:230;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q6">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">士</v:TextBox >
    </v:oval>
 
    <v:oval id="q7" style="left:280;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q7">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">象</v:TextBox >
    </v:oval>
 
    <v:oval id="q8" style="left:330;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q8">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">马</v:TextBox >
    </v:oval>
 
    <v:oval id="q9" style="left:380;top:-20;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q9">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">车</v:TextBox >
    </v:oval>
 
    <v:oval id="q10" style="left:30;top:80;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q10">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">炮</v:TextBox >
    </v:oval>
 
    <v:oval id="q11" style="left:330;top:80;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q11">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">炮</v:TextBox >
    </v:oval>
 
    <v:oval id="q12" style="left:-20;top:130;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q12">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">卒</v:TextBox >
    </v:oval>
 
    <v:oval id="q13" style="left:80;top:130;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q13">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">卒</v:TextBox >
    </v:oval>
 
    <v:oval id="q14" style="left:180;top:130;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q14">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">卒</v:TextBox >
    </v:oval>
 
    <v:oval id="q15" style="left:280;top:130;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q15">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">卒</v:TextBox >
    </v:oval>
 
    <v:oval id="q16" style="left:380;top:130;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="gray" strokeWeight="1" οnclick="sel(this);" title="q16">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">卒</v:TextBox >
    </v:oval>
 
    <v:oval id="q17" style="left:-20;top:280;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q17">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">兵</v:TextBox >
    </v:oval>
 
    <v:oval id="q18" style="left:80;top:280;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q18">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">兵</v:TextBox >
    </v:oval>
 
    <v:oval id="q19" style="left:180;top:280;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q19">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">兵</v:TextBox >
    </v:oval>
 
    <v:oval id="q20" style="left:280;top:280;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q20">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">兵</v:TextBox >
    </v:oval>
 
    <v:oval id="q21" style="left:380;top:280;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q21">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">兵</v:TextBox >
    </v:oval>
 
    <v:oval id="q22" style="left:30;top:330;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q22">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">炮</v:TextBox >
    </v:oval>
 
    <v:oval id="q23" style="left:330;top:330;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q23">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">炮</v:TextBox >
    </v:oval>
 
    <v:oval id="q24" style="left:-20;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q24">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">车</v:TextBox >
    </v:oval>
 
    <v:oval id="q25" style="left:30;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q25">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">马</v:TextBox >
    </v:oval>
 
    <v:oval id="q26" style="left:80;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q26">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">相</v:TextBox >
    </v:oval>
 
    <v:oval id="q27" style="left:130;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q27">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">仕</v:TextBox >
    </v:oval>
 
    <v:oval id="q28" style="left:180;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q28">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">帅</v:TextBox >
    </v:oval>
 
    <v:oval id="q29" style="left:230;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q29">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">仕</v:TextBox >
    </v:oval>
 
    <v:oval id="q30" style="left:280;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q30">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">相</v:TextBox >
    </v:oval>
 
    <v:oval id="q31" style="left:330;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q31">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">马</v:TextBox >
    </v:oval>
 
    <v:oval id="q32" style="left:380;top:430;width:40;height:40;Z-INDEX:9;cursor:hand;" fillColor="red" strokeWeight="1" οnclick="sel(this);" title="q32">
     <v:shadow on="Ture" type="single" color="#8b4513" offset="3px,3px"/>
     <v:TextBox inset="2pt,2pt,1pt,1pt" style="Z-INDEX:4;font-size=24;font-weight:bold;FILTER: glow(color=#ffffff,strength=1);">车</v:TextBox >
    </v:oval>

    
 </v:group>
 <div id=ppp>超级大笨狼象棋:单击选取棋子,右键取消</div>测试:<div id=qqq>超级大笨狼象棋:单击选取棋子,右键取消</div> 
<script language="JScript">
var myColor="red";
var enemyColor="gray";
var qiNum=32;//棋子数量
var qID="";
var qName="";
var xx=0;//起点坐标
var yy=0;
var xxx=0;//终点坐标
var yyy=0;
var step=0;
var eatNum=0;

//*******以下是选择棋子和目标部分**********

function sel(obj){ 
//如果手中无棋,选中棋子,否则确定目标点
 
 if(obj.fillColor != myColor ) {
  return;
 }
  if(qID!="" && qID!=obj.id){
 
  target();
  }

 selectNull();
 if(obj.strokeWeight==1){
  obj.style.zIndex=5;
  obj.strokeWeight=2;
  obj.strokeColor="Navy" ;
  qID=obj.id;
  qName=obj.innerText.replace(/(^/s*)|(/s*$)/g,"");
  xx=parseInt(obj.style.left);
  yy=parseInt(obj.style.top);
 } 
 window.event.cancelBubble=true;
 ppp.innerText=xx+":"+yy;
}


function target(){ 
//选中目标
 var tempX=(parseInt(event.clientX) - 62) / 50;
 var tempY=(parseInt(event.clientY) - 62) / 50;
 tempX=(50 * Math.round(tempX)) -20;
 tempY=(50 * Math.round(tempY)) -20; 
 ppp.innerText= tempX.toString() + ":" + tempY.toString(); 
 if(qID=="" || rule(qName,xx,yy,tempX,tempY)==false || (tempX<-20 ||tempX > 380||tempY<-20||tempY>430) ){
  return;
 }
 xxx=tempX;
 yyy=tempY;
 if (getQ_xy(xxx,yyy) ==""){
  gogo(xxx,yyy);//走过去
 }
 else{
  if(document.getElementById(getQ_xy(xxx,yyy)).fillColor != myColor){
   eat(getQ_xy(xxx,yyy),xxx,yyy);
  }
 }  
 
}
function selectNull(){
  for(i=1 ;i<=qiNum;i++){
   document.getElementById("q" + i).strokeWeight=1;
   document.getElementById("q" + i).style.zIndex=3;
   document.getElementById("q" + i).strokeColor="black" ;   
  }
  qID=""; 
  qName="";
  xx=0;
  yy=0;
  xxx=0;
  yyy=0;
}
//********以下是走棋和杀棋部分********

function gogo(x,y){
 if (qID !=""){ 
  var obj=document.getElementById(qID);  
  obj.style.left=x;
  obj.style.top=y;
  obj.style.zIndex=3; 
  selectNull(); 
 }
}

function eat(deadID,x,y){
//吃掉对方棋子
 eatNum+=1;
 var obj=document.getElementById(deadID);
 obj.style.top=eatNum * 50;
 obj.style.left=600;
 //document.getElementById(deadID).style.display="none";
 gogo(x,y);//走过去 
 if(isKing(deadID)){
  alert("你取得了胜利!");
 }
}


//*********以下是行棋规则部分*************
//走棋规则
function rule(chessName,x1,y1,x2,y2){ 
 var rtn=false; 
 switch (chessName){
  case "车":
   rtn=ruleChe(x1,y1,x2,y2);
   break; 
  case "马":
   rtn=ruleMa(x1,y1,x2,y2);
   break;  
  case "象":  
   rtn=ruleXiang(x1,y1,x2,y2);
   break;
  case "相":  
   rtn=ruleXiang(x1,y1,x2,y2);
   break; 
  case "士":  
   rtn=ruleShi(x1,y1,x2,y2);
   break;
  case "仕":  
   rtn=ruleShi(x1,y1,x2,y2);
   break; 
  case "将":  
   rtn=ruleJiang(x1,y1,x2,y2);
   break; 
  case "帅":  
   rtn=ruleJiang(x1,y1,x2,y2);
   break;
  case "炮":  
   rtn=rulePao(x1,y1,x2,y2);
   break; 
  case "兵":  
   rtn=ruleBing(x1,y1,x2,y2);
   break; 
  case "卒":  
   rtn=ruleBing(x1,y1,x2,y2);
   break;
  default:
   rtn=false;
   break; 
 }
 
 return(rtn); 
}
//车的走法
function ruleChe(x1,y1,x2,y2){
 var rtn=false;
 //1,面积是0
 var area=getArea(x1,y1,x2,y2); 
 if(area==0){
  //2,前进路上无其他子
  if((( isX(x1,y1,x2,y2) ) && (getQ_x(x1,x2,y1) =="") )||(( !isX(x1,y1,x2,y2) ) && (getQ_y(y1,y2,x1) =="") ) ){
   rtn=true;
  }
 }  
 return(rtn);
}
//马的走法
function ruleMa(x1,y1,x2,y2){

 var rtn=false;
 //1,面积是50 * 100  
 var area=getArea(x1,y1,x2,y2); 
 if(area==5000 ){  
  //2,长轴上无子
   if ( ( (isX(x1,y1,x2,y2)==true) && (getQ_x(x1,x2,y1)=="") ) || ( (isX(x1,y1,x2,y2)==false) &&  (getQ_y(y1,y2,x1)=="")  )){
    rtn=true;
   }
 }
 return(rtn);
}
//象的走法
function ruleXiang(x1,y1,x2,y2){
 var rtn=false; 
 //1,面积是100 * 100 而且不是大飞
 var area=getArea(x1,y1,x2,y2); 
 if(area==10000 && (Math.abs((y1-y2))==Math.abs((x1-x2)))){
  //2,不过河y2>=230
  if(y2>=230){ 
   //3,无象眼(x2+x1)/2,(y2+y1)/2位置无棋子   
   if(getQ_xy((x2+x1)/2,(y2+y1)/2)==""){
    rtn=true;
   }
  }
 }
 return(rtn);
}
//士的走法
function ruleShi(x1,y1,x2,y2){

 var rtn=false;
 //1,面积是50*50
 var area=getArea(x1,y1,x2,y2); 
 if(area==2500 ){
  //2,不出9宫x2(130-230)y2(330-430) 
  if(x2>=130 && x2<=230 && y2>=330 && y2<=430){
   rtn=true;
  }
 }
 return(rtn);
}
//将的走法
function ruleJiang(x1,y1,x2,y2){

 var rtn=false;
 //1,某方向只走一格 
 if(isSingle(x1,y1,x2,y2)){
 //2,不出9宫x2(130-230)y2(330-430)
  if(x2>=130 && x2<=230 && y2>=330 && y2<=430){
   rtn=true;
  }
 }
 //3,照面可以笑杀:在y轴和对方老将中间无棋
 //如果是老将
 var tempID=getQ_xy(x2,y2);
 if(isKing(tempID)){
  if(getQ_y(y1,y2,x1)==""){
  //如果中间无棋
   rtn=true;
  }
 
 }
 return(rtn);
}
//炮的走法
function rulePao(x1,y1,x2,y2){
 var rtn=false;
 //0,满足车的走法,并且目标点没有棋子
 if(ruleChe(x1,y1,x2,y2)==true && getQ_xy(x2,y2)==""){
 rtn=true;
 }
 else{ 
  //或者满足下面走法:
  //1,面积是0
  var area=getArea(x1,y1,x2,y2); 
  if(area==0 ){
  //2,目标位置是敌人
   var tempID=getQ_xy(x2,y2);
   if(isEnemy(tempID)){
   //2,中间有且只有一个棋子
    if( ( (isX(x1,y1,x2,y2) ==false) && ( getQ_y(y1,y2,x1).length==2 || getQ_y(y1,y2,x1).length==3) )||( (isX(x1,y1,x2,y2) == true) && ( getQ_x(x1,x2,y1).length==2 || getQ_x(x1,x2,y1).length==3 ) ) ){
    rtn=true;
    }
   }
  }
 }
 return(rtn);
}
//兵的走法
function ruleBing(x1,y1,x2,y2){
 var rtn=false;  
 //1,不能后退
 if(y2-y1<=0){
  //2,只走一格
  if(isSingle(x1,y1,x2,y2)){
   //3,过河前竖走
   if(y1>=230 && (!isX(x1,y1,x2,y2))){
   rtn=true;
   }
    //4,过河后随便
   if(y1<230){
   rtn=true;
   }
  
  }
 }
 return(rtn);
}

//*********以下是行棋规则辅助函数部分***********

function getArea(x1,y1,x2,y2){
 //得到面积
 var rtn=0;
 rtn=Math.abs((x1-x2)*(y1-y2)); 
 return(rtn);
}
function isX(x1,y1,x2,y2){
//判断是否x方向比y方向长
 var rtn=false;
 if (Math.abs(y1-y2)<Math.abs(x1-x2)){
  rtn=true;
 }
 return(rtn);
}
function isSingle(x1,y1,x2,y2){
//是否某方向只动了一格
 var rtn=false;
   //1,面积是0
 var area=getArea(x1,y1,x2,y2); 
 if(area==0 ){
 //两面只能一格
  if ( ( (!isX(x1,y1,x2,y2))  && Math.abs(y1-y2)==50 ) || ( isX(x1,y1,x2,y2) && Math.abs(x1-x2)==50 )){
   rtn=true;
  }
 }
 return(rtn);
}
//*********以下是得到棋盘某点线状态部分************

function getQ_xy(x,y){
//得到某点棋子id
  var rtn="";
   for(j=1;j <= 32;j++){
   if (parseInt(document.getElementById("q" +j ).style.left)==x && parseInt(document.getElementById("q" +j ).style.top)==y){
    rtn="q" + j;    
   }
  } 
  //qqq.innerText=rtn ; 
  return(rtn.replace(/(^/s*)|(/s*$)/g,""));  
}

function getQ_x(x1,x2,y){
//得到x轴向两点的棋子id连接的字串
 var rtn="";  
 for(i=Math.min(x1,x2)+50;i<Math.max(x1,x2);i+=50){
  rtn+=getQ_xy(i,y);
 } 
 return(rtn.replace(/(^/s*)|(/s*$)/g,""));
}
function getQ_y(y1,y2,x){
//得到y轴向两点的棋子id连接的字串
 var rtn="";  
 for(i=Math.min(y1,y2)+50;i<Math.max(y1,y2);i+=50){
  rtn+=getQ_xy(x,i);
 }
 //qqq.innerText=rtn ;
 return(rtn.replace(/(^/s*)|(/s*$)/g,""));
}
//判断某点是否是敌人
function isEnemy(tempID){
 var rtn=false; 
 if (tempID!=""){
  if(document.getElementById(tempID).fillColor != myColor){
  rtn=true;
  }
 }
 
 return(rtn);
}
//判断某点是否是敌人老将
function isKing(tempID){
 var rtn=false; 
  if (isEnemy(tempID)){  
  var kingName=document.getElementById(tempID).innerText.replace(/(^/s*)|(/s*$)/g,"");  
  if( kingName=="将" || kingName=="帅" ){
   rtn=true;
   
  }
 }
 
 return(rtn);
}
</script>
 

</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值